[REBOL] [bind] Patrick's pages ; using 'local ; using bind/copy
From: rebol:meurrens at: 14-May-2003 13:07
Hello all,
Bonjour Patrick,
CC to the contributors of Patrick's pages on "bind",
SUMMARY: visit http://rebol.mksa.net/bind-demo-1.r?help
As a fresh new rebolutionar, I appreciate the help provided by the communauty
and a.o. I found in your pages all the explanations about this mysterious/magic
'bind word...
Thanks...
However, I have 2 small concerns regarding the "solution 3.1" of your
exbind.html
page.
1. I think that it would be more neat to *allways* bind,
when binding your words to a local function context,
by referring to 'local (the pseudo refinement allways present...) rather
than relying
on a specific variable. It works also for functions without parameters...
2. Another issue is that your example use "bind" rather than "bind/copy"
Even if, in your small example, this is ok, I would suggest to emphasize
instead
the use of the /copy refinement.
I think it would be stupid to create (on my own site) still another page
related to bind
just to publish these very small comments
but I suggest instead that, after discussion of my remarks, the "main"
pages on bind
(namely, Patrick's pages) should eventually be updated.
Everything is detailled as explained in the header partially provided below:
REBOL [
Url: http://rebol.mksa.net/bind-demo-1.r?help
Credits: {
1. The REBOL dictionnary entry is at URL:
http://www.rebol.com/docs/words/wbind.html
2. A good introduction by Brett Handley can be found at:
http://www.codeconscious.com/rebol/deeper-techniques.html#Usingcodeblocksandbind
2. An excellent tutorial on bind by Patrick Philipot
(10-mar-2002, 11-mar-2002 version: 1.01) is at:
http://www.pat665.free.fr/doc/bind.html
an example (author: pat665 date: 3-nov-2002 contributions: Ladislav
and Gabriele)
is available on Patrick's site at:
http://www.pat665.free.fr/doc/exbind.html
3. However the solution proposed in 3.1 of this exbind.html page
- binds the block to a variable 'nb1 which is ok,
... but binding to 'local would be more neat
- does not bind/copy which is ok for the example
... but may be wrong in most cases
}
Purpose: {
- demonstrates the use of the 'local "pseudo refinement"
to bind a block to the local context of a function.
- demonstrates the consequences of " bind " and " bind/copy "
respectively
}
Usage: {
demo: %http://rebol.mksa.net/bind-demo-1.r
browse join demo "?help"
print read demo
do demo
}
]
Regards,
</marc>
Prof. Ir Marc Meurrens, Brussels (be)
TEL: +32 (0)2 537 2812
FAX: +32 (0)2 537 7645
EMAIL: [marc--meurrens--org]
URL: http://www.meurrens.org/
REB: http://rebol.mksa.net/
PGPKEY: http://www.meurrens.org/pgp/
Please don't mail me attached files, instead, use my 'exchange area' :
EXCHANGE AREA: http://www.meurrens.org/exchange/
(HTTP/FTP upload/download of temporary/persistent files)