Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: ROUND function (like TRUNC, FLOOR, etc...)

From: lmecir:mbox:vol:cz at: 23-Feb-2002 19:00

Hi Gabriele, <<Joel>> 1) ask for the context of a specific word; <</Joel>> <<Gabriele>> That would be useful, but mainly only if you were able to ask CONTEXT! what other words it has, and things like these; i.e. only if it behaved like OBJECT!. (Which is like asking RT to turn every CONTEXT! into an OBJECT! --- pretty ironic conclusion for a thread that started with "'CONTEXT is a confusing name for a function that makes OBJECT!s". :) <</Gabriele>> I am not missing such a function badly... <<Joel>>
>2) use a context as the explicit second argument to BIND;
<</Joel>> <<Gabriele>> If you already have a word bound to it... (Well, that said, I'd like to have BIND accept at least OBJECT!s, to avoid that extra IN, but even more to accept functions etc. to avoid all the magic needed to get to it...) <</Gabriele>> Yes, I think, that there are no reasons why BIND shouldn't accept an object or a function, or why IN shouldn't accept a function? <<Joel>> 4) be able easily to ask whether two words belonged to the same context; <</Joel>> I am quite satisfied with what I am able to do now. <<Joel>>
>5) ask whether a specific word belonged to a specific context;
<</Joel>> Not very important for me. <<Joel>>
>and so on ... Making contexts first-class would be consistent with >the REBOL approach that "everything is just a value" and would likely >help de-mystify some of the more interesting things that REBOL can do >that can't even be *said* in some other languages.
<</Joel>> <<Gabriele>> I agree here. (I second Ladislav in his desire to have all REBOL types as first-class.) <</Gabriele>> What I really ask for is first class properties for all Rebol values (see the example of ERROR! type values or UNSET! type value or circular blocks regularly crashing the interpreter, etc.). I am not asking for a datatype called CONTEXT!. (although some Rebol programmers might find that useful ...) <<Joel>>
>A nice notation for (1) would be > > context some-word
<</Joel>> <<Gabriele>> I'd say CONTEXT-OF, or GET/CONTEXT (this looks pretty consistent and clean --- with GET you have the value, with GET/CONTEXT you have the context; you could even replace BIND with SET/CONTEXT... :). <</Gabriele>> I admit, that It might be useful sometimes... Cheers L