The strange thing for me is that you can use /local as a refinement and pass
the values of the locals vars as arguments.

I thinked that local was a special keyword for locals vars, not a refinement
like the all the others.

---
Ciao
Romano

----- Original Message -----
From: "Paul Tretter" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 03, 2001 10:07 PM
Subject: [REBOL] Re: Function Context Query


> Seems pretty clear:
>
> >> source has
> has: func [
>     {A shortcut to define a function that has local variables but no
> arguments.}
>     locals [block!]
>     body [block!]
> ][function [] locals body]
> >> source a1
> a1: func [/local b c][print b print c]
> >>
>
> Paul Tretter
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
> Romano Paolo Tenca
> Sent: Monday, December 03, 2001 10:31 AM
> To: [EMAIL PROTECTED]
> Subject: [REBOL] Re: Function Context Query
>
>
> Hi, Mark
>
> > Surely this is incorrect?
> >
> > >> a: has [b c] [ print b print c]
> > >> a
> > none
> > none
> > >> a/local 3 4
> > 3
> > 4
>
> Amazing! At least for me!
>
> This demostrates that /local is a refinement like any other, only for
> convention it is used for defining local. One can use another one. The only
> difference is that at least Help is aware of the convention about local and
> does not put /local about user refinements.
>
> There is no difference between:
>
> a1: has [b c] [ print b print c]
> a2: func [/k b c] [ print b print c]
> a1
> a2
> a1/local 2 3
> a2/k 2 3
>
> ---
> Ciao
> Romano
>
>
> >
> > Surely local words default value should be unset
> > until they are defined?
> >
> > Also in the second case is it correct to be
> > able to pass values to local words in this manner?
> >
> > How is the above different from this....
> >
> > >> use [b c] [print b print c]
> > ** Script Error: b has no value
> > ** Near: print b print c
> >
> > Can somebody please explain the wisdom of this
> > or is it a bug?
> >
> > cheers,
> >
> > Mark Dickson
> > --
> > To unsubscribe from this list, please send an email to
> > [EMAIL PROTECTED] with "unsubscribe" in the
> > subject, without the quotes.
> >
>
> --
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the
> subject, without the quotes.
>
> --
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the
> subject, without the quotes.
>

-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to