removed the association literal notation

This commit is contained in:
hyunghwan.chung
2017-03-09 07:26:43 +00:00
parent 8bf134e8e3
commit 3bfffe09d9
9 changed files with 57 additions and 166 deletions

View File

@ -460,7 +460,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.
*)
@ -473,6 +473,10 @@ class Dictionary(Set)
hv := key hash.
index := hv rem: bs.
(* as long as 'assoc' supports the message 'key' and 'value'
* this dictionary should work. there is no explicit check
* on this protocol of key and value. *)
while ((ass := self.bucket at: index) notNil)
{
if (key = ass key)
@ -497,7 +501,9 @@ class Dictionary(Set)
self.tally := ntally.
self.bucket at: index put: assoc.
^self. ## it must return self for the instructions generated by the compiler.
(* it must return self for the instructions generated by the compiler.
* otherwise, VM will break. *)
^self.
}
}