interim commit of various experiments

This commit is contained in:
hyunghwan.chung
2017-06-16 09:45:22 +00:00
parent 9b3c3007fd
commit d311c7cb6e
20 changed files with 444 additions and 1463 deletions

View File

@ -7,7 +7,7 @@ class(#pointer,#limited) Class(Apex)
var spec, selfspec, superclass, subclasses, name, modname.
var instvars, classinstvars, classvars, pooldics.
var instmthdic, classmthdic, nsup, nsdic.
var trsize, initv, initv_ci.
var trsize, trgc, initv, initv_ci.
method(#class) initialize { ^self }

View File

@ -451,7 +451,7 @@ class Dictionary(Set)
{
(* [NOTE]
* VM require Dictionary to implement new: and __put_assoc
* for the dictionary expression notation - :{ }
* for the dictionary expression notation - %{ }
*)
## TODO: implement Dictionary as a Hashed List/Table or Red-Black Tree
@ -466,7 +466,7 @@ class Dictionary(Set)
* to a dictionary with the dictionary/association expression notation
* like this:
*
* :{ 1 -> 20, #moo -> 999 }
* %{ 1 -> 20, #moo -> 999 }
*
* it must return self for the way VM works.
*)

View File

@ -216,28 +216,24 @@ class MyObject(Object)
a :=999.
a := #{
a := %(
1,
2,
a,
4,
1 + 1,
#{ 1, 2, #{a, a := a + 1, a, if (a > 10) { a + 20 } }, 3},
%( 1, 2, %(a, a := a + 1, a, if (a > 10) { a + 20 } ), 3),
2 + 2,
#'a b c'
}.
).
(* Dictionary ???
a := #{
a := %{
key -> value ,
key -> value ,
key -> value ,
key -> value
}
a := :{
key -> value,
}
),.
*)
a do: [ :v | v dump].
@ -278,7 +274,7 @@ class MyObject(Object)
}.*)
a := :{
a := %{
'aaa' -> 10,
'bbb' -> 20,
'bbb' -> 30,
@ -368,6 +364,6 @@ a free.
(*
pooldic XXD {
#abc := #(1 2 3).
#def := #{ 1, 3, 4 }. ## syntax error - literal expected where #{ is
#def := %( 1, 3, 4 ). ## syntax error - literal expected where %( is
}
*)

File diff suppressed because it is too large Load Diff

View File

@ -108,7 +108,7 @@ extend MyObject
{
| tc limit |
tc := #{
tc := %(
## 0 - 4
[MyObject.Donkey v == 901982],
[selfns.MyObject.Donkey v == 901982],
@ -160,7 +160,7 @@ extend MyObject
## 35 - 39
[MyObject.System.System.System KING == #KING]
}.
).
limit := tc size.
MyObject.System.System a: XX.AAAA.

View File

@ -21,11 +21,11 @@ class MyObject(Object)
{
| tc limit |
tc := #{
tc := %(
## 0 - 4
[ self proc1 == 100 ],
[ Processor sleepFor: 2. self proc1 == 200 ]
}.
).
limit := tc size.