[REBOL] Re: ROUND function (like TRUNC, FLOOR, etc...)
From: g:santilli:tiscalinet:it at: 24-Feb-2002 12:10
At 18.06 23/02/02, you wrote:
>Well, perhaps I understood the original question. I took
>"create a context" to mean constructing an environment with
>one or more words not in the global contxt, not in the sense
>of obtaining a "direct reference to the context"; I think
I think both are important...
>we've both stated in various ways that REBOL doesn't really
>give a way to access contexts (per se) directly.
Yes. But objects are very close IMHO.
>As for your commeonts on the numbered list of things one
>could do with a first-class context, perhaps I didn't express
>sufficiently clearly that I considered them all to be inter-
>related. For example...
Yes, sorry I think that the one being unclear was me. I just think that 1
and 2 are not useful if not to be able to do 4 and 5.
[1]
>No, sorry, I wasn't asking for object-like behavior.
Then the CONTEXT! value is only useful for 4 and 5, IMHO.
>If contexts were first class, one *wouldn't* need a word that
>is already bound to it. That was my whole point. Let's put
>items (1) and (2) together and consider the following
>(imaginary) bit of REBOL:
>
> use [ini mini meini mo] [
> ini: mini: meini: mo: none
> ;
> ; some functions that do interesting things, using
> ; those four "private" words to maintain state
> ;
> immm-namespace: func [] [get-the-context-of ini]
> ]
But you see that you've been using a word bound to the context to be able to
get the context. So imagine I just do this:
use [ini mini meini mo] [
ini: mini: meini: mo: none
; etc.
immm-namespace: func [] ['ini]
]
a-context-var: immm-namespace
; ...
flarp a-context-var other-args...
flarp: func [ctxt [word!] ...] [
; ...
bind [ini] ctxt
; ...
]
The only things I cannot do are 4 and 5.
>Being able to do (1) and keep the result, pass it as an argument,
>or whatever else one does with a first-class value, provides a
>simple way to do (4) and (5) in terms of the context itself,
>rather than having to keep around some specific word within the
>context.
Yes, sorry again if I've been unclear.
>Therefore, I'm puzzled that we agree on the value of (4), (5),
>and the general issue of first-class-hood, and yet don't see
>(1) and (2) alike...
:-)
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r