[squeak-dev] DynamicObjects

Torge Husfeldt torge.husfeldt at gmx.de
Sun Apr 19 21:32:45 UTC 2020


Hi Chris, 
something very similar actually used to be a “thing” in squeak back in the olden times.
It was called a “trampoline” iirc.
Might be worth trying to google that ;)
Hth
Torge

Von meinem iPhone gesendet

>> Am 18.04.2020 um 19:55 schrieb Thiede, Christoph <Christoph.Thiede at student.hpi.uni-potsdam.de>:
> 
> d := DynamicObject withMethods: {
> #origin -> [2 @ 3].
> #corner -> [3 @ 7] } asDictionary.
> d origin "2 at 3"
> 
> 
> Did we already have something like this for Squeak? May this become a pattern for situations where you actually don't need a class (e. g., when writing very small mock objects for tests)?
> 
> 
> 
> d := DynamicObject new.
> d xxxMethodAt: #foo put: [self inform: 'Hi!'].
> d xxxMethodAt: #foo: put: [:x | x halt].
> d foo: 3.
> 
> Best,
> Christoph
> <DynamicObject.st>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200419/5d269a6e/attachment.html>


More information about the Squeak-dev mailing list