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

[REBOL] Re: the utility of 'bind

From: lmecir:mbox:vol:cz at: 21-Jan-2004 20:58

Andreas Bolka napsal(a):
>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? >
Hi Andreas, BIND can be used to program e.g. a WITH function like with object [do something] I don't remember all cases where I used BIND. One case I recently actualized was when I tried to circumvent the limitations of RETURN and function attributes. To describe the usage of BIND there: I defined (locally) the functions called RETURN', THROW' and EXIT' having different behaviour, than their native counterparts. Then I supposed, that a user would supply a code block using the above words. I used BIND to give the meaning to the words supplied from outside. When I think about it now, I could do it without BIND using the USE function only, but it would be less readable at least. -Ladislav