[REBOL] Re: of
From: lmecir:mbox:vol:cz at: 9-Nov-2004 13:49
Anton Rolls napsal(a):
>I just was thinking of a nice little function, OF:
> of: func [
> "does code in the context of the object"
> obj [object!] code [block!]
> do bind code in obj 'self
>These are equivalent
> face/data: 3
> face/text: "hello"
> face/edge/size: 3x3
> of face [data: 3 text: "hello" edge/size: 3x3]
>For the function name, I decided to avoid the word, familiar
>to VB programmers, "WITH", because it might get confusing
>used in (or near) the layout dialect, and it's nice and
>short. Another possible name is "DO-IN", but the longer
>the word is the less chance it will actually save any
>I wonder if anyone else made such a function or a similar
I posted such a function called WITH once. The biggest difference is,
that my function didn't return the object, I preferred it to return the
result of the computation. A smaller difference is a [throw] attribute.