forked from paulfitz/daff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathView.hx
95 lines (83 loc) · 2.01 KB
/
View.hx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// -*- mode:java; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
#if !TOPLEVEL
package coopy;
#end
/**
*
* Interface for interpreting cell contents. In most cases the implementation
* will be entirely trivial.
*
*/
interface View {
/**
*
* Convert a cell to text form.
* @param d a cell
* @return the cell in text form
*
*/
function toString(d: Dynamic) : String;
/**
*
* Compare two cells.
* @param d1 the first cell
* @param d2 the second cell
* @return true if the cells are equal
*
*/
function equals(d1: Dynamic, d2: Dynamic) : Bool;
/**
*
* Convert a string to a cell.
* @param str the string
* @return the string converted to a cell
*
*/
function toDatum(str: String) : Dynamic;
/**
*
* Create a native hash/map object.
* @return the newly created hash/map, or null if not available
*
*/
function makeHash() : Dynamic;
/**
*
* Add something to a native hash/map object.
* @param h the hash/map
* @param str the key to use
* @param d the value to use
*
*/
function hashSet(h: Dynamic, str: String, d: Dynamic) : Void;
/**
*
* @param h possible hash/map to check
* @return true if h is a hash/map
*
*/
function isHash(h: Dynamic) : Bool;
/**
*
* Check if a hash/map contains a given key
*
* @param h hash/map to check
* @param str key to check
* @return true if hash/map contains the given key
*
*/
function hashExists(h: Dynamic, str: String) : Bool;
/**
*
* Check if a hash/map contains a given key
*
* @param h hash/map to check
* @param str key to check
* @return true if hash/map contains the given key
*
*/
function hashGet(h: Dynamic, str: String) : Dynamic;
function isTable(t : Dynamic) : Bool;
function getTable(t : Dynamic) : Table;
function wrapTable(t : Table) : Dynamic;
}