| |
| /pliant/storage/database/set.pli |
| |
| 1 |
abstract | |
| 2 |
[This is the generic] ; fixed [ Set ] ; [type that contains what is usually called a table in database vocabulary.] ; eol | |
| 3 |
[Such an object will be accessed by the database engine through the ] ; link "DataTable" "inmemory.pli" section "type DataTable" ; [ interface defined in ] ; link "inmemory.pli" "inmemory.pli" ; [ module.] | |
| 4 |
| |
| 5 |
scope "/pliant/storage/" "/pliant/appli/" | |
| 6 |
module "/pliant/language/compiler.pli" | |
| 7 |
| |
| 8 |
| |
| 9 |
gvar Relation 'pliant data set types' 'pliant data setnode types' | |
| 10 |
export 'pliant data set types' 'pliant data setnode types' | |
| 11 |
| |
| 12 |
function Set t -> tt | |
| 13 |
arg Type t ; arg_R Type tt | |
| 14 |
has_no_side_effect | |
| 15 |
| |
| 16 |
var Address adr := 'pliant data set types' query addressof:t null | |
| 17 |
if adr<>null | |
| 18 |
return (adr map Type) | |
| 19 |
| |
| 20 |
runtime_compile Value t Set (cast "(Set "+t:name+")" Ident) SetNode (cast "(SetNode "+t:name+")" Ident) | |
| 21 |
| |
| 22 |
type SetNode | |
| 23 |
field IndexNode_ node | |
| 24 |
field Str key | |
| 25 |
field Value value | |
| 26 |
| |
| 27 |
type Set | |
| 28 |
field Index_ tree | |
| 29 |
| |
| 30 |
function destroy s | |
| 31 |
arg_w Set s | |
| 32 |
s:tree reset SetNode true | |
| 33 |
| |
| 34 |
export Set | |
| 35 |
'pliant data set types' define addressof:Value null addressof:Set | |
| 36 |
'pliant data setnode types' define addressof:Value null addressof:SetNode | |
| 37 |
'pliant set types' define addressof:Set addressof:Set addressof:(new Str "Set") | |
| 38 |
'pliant set types' define addressof:Set null addressof:Str | |
| 39 |
'pliant set types' define null addressof:Set addressof:Value | |
| 40 |
| |
| 41 |
var Address adr := 'pliant data set types' query addressof:t null | |
| 42 |
check adr<>null | |
| 43 |
return (adr map Type) | |
| 44 |
| |
| 45 |
export Set | |
| |