[REBOL] Words, Bindings and Contexts. (7) Re:(2)
From: lmecir:geocities at: 26-Jul-2000 22:36
Hi,
> HI Ladislav
>
> Very cool! Use of simulated behavior (implemented in REBOL) is
a concise
> and precise way of expressing one's thoughts about the workings
of REBOL
> functions. I find it much more informative than lengthy
attempts to
> describe in ordinary language how functions work.
>
> I have followed your Words, Bindings, and Contexts posts with
great
> interest. I have learned a lot from your discussions and hope
to see more.
> Just a couple of quick questions:
>
> Can you say more about Dangerous Contexts? For instance:
> >> f: func [x][return x]
> >> first :f
> == [x]
> >> type? first first :f
> == word!
> >>value? first first :f ;REBOL crashes on any attempt to
examine the
> words in first :f
>
> Isn't this just a bug in REBOL? Why does it not return an error
instead of
> crash?
>
> How about a modifying to sim-func to allow handling of /local
and
> refinements? Then it would be a more complete model of func.
>
> Thank you again for sharing this excellent material.
>
> -Larry
>
1) I think, that every Rebol Context becomes Dangerous after being
Garbage Collected while still accessible, ie. Dangerous Contexts
may be just "Ghost Contexts" of once normal Rebol Contexts...
2) My intent was to describe the Rebol Context Handling and the
refinements would complicate the code beyond the limit I
considered acceptable. (BTW, if you consider Sim-function/spec as
containing all Function Context's Words ie. Arguments,
Refinements, Words specified as /local, everything holds, the
things that should be added are the examination of a call-path
used, a code to supply None as the value for respective Function
Context's Words, a code for spec parsing and the type checking
code.)