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

[REBOL] Re: the utility of 'bind

From: nitsch-lists:netcologne at: 21-Jan-2004 22:04

Am Mittwoch 21 Januar 2004 18:41 schrieb Andreas Bolka:
> I will spare you my thoughts about REBOL's contexts and 'bind (for > now) but I have a practical question: > > What is the utility of 'bind? No, I don't necessarily mean the typical > cases where bind is needed to prevent errors. What I'm really thinking > about are situations, where REBOL's behaviour regarding contexts and > bind is actually contributing towards an elegant solution for a real > problem. > > I think I remember various parse-based solutions posted to the list, > that utilized bind. This is basically a question to those who > understand _and_ use 'bind to actually solve problems: What do you use > it for? Do you think REBOL's behaviour in those regards is practical? > Are you aware of elegant solutions based on 'bind?
IMHO 'bind is a low-level tool. Usually 'bind is used implicitely in 'func and [make object![]] and makes good sense there. sometimes one wants to add code later as if it was immediate there. then 'bind makes some things possible. for example, if one wants to add a function to an object later, which shall use the objects wars implicitly. a: context[ b: 1 c: 2 f: none] a/f: func[][b + c] does not work. uses global 'a and 'b. a/f: func[] bind [b + c] in a 'self works. (often used to patch inbuild functions which are defined some context-levels deep). -Volker