Accessing 'this' in blocks is done via currySelf message sent to a block to transform it so it gets this as the first parameter. Inside method, of course self is 'this'.
Dňa 17. februára 2015 11:41:19 CET používateľ Norbert Hartl <
[hidden email]> napísal:
I have the impression this might be a dumb question but…
What role does "this" play in amber? And how can I access it? I'm trying to parse a JSON string and use the
JSON.parse( string, reviver)
So I can do
JSON parse: '{ "a" : { "b" : "c" }}' with: [ :key :value |
Transcript show: '* '; show: key; show: ' -> '; show: value; cr ]
The parse is a depth-first traversal and the current object that is parsed seems to be accessible via "this". So I would need acess to it in order to be able to nest properly.
Norbert
--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
[hidden email].
For more options, visit
https://groups.google.com/d/optout.