Content deleted Content added
→Scala: copy editing |
→Smalltalk: copy editing |
||
Line 1,716:
This returns an <code>Option</code> type, Scala's equivalent of the [[Monad (functional programming)#The Maybe monad|Maybe monad]] in Haskell.
===
In [[Smalltalk]] a
<syntaxhighlight lang=Smalltalk>
Line 1,726:
</syntaxhighlight>
To access an entry the message <code>#at:</code> is sent to the dictionary object
<syntaxhighlight lang=Smalltalk>
Line 1,732:
</syntaxhighlight>
Which gives:
<syntaxhighlight lang=Text>
'555-9999'
</syntaxhighlight>
[[Garbage collection (computer science)#Strong and weak references|strong references]]
Because every object implements #hash, any object can be used as key (and of course also as value).
|