Alias has more value for making different language versions. When a word is aliased it affects all contexts where that word is used.
e.g alias 'text "libre" == libre >> text ** Script Error: text has no value ** Near: text view layout [libre "hi there"] Cheers, Allen K ----- Original Message ----- From: "Ammon Johnson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, November 10, 2001 9:08 AM Subject: [REBOL] Re: Best way to alias words > Hi, > > Incidently I was just playing with this. The thing that I noticed is > that the Alias function will not reasign the value of a word. 'Help is used > by REBOL as a function. I think you are going to run into the most trouble > trying to 'Alias them. > > I would *love* to see Joel run some benchmarks on the difference > between, ?: Help: [], & Help: :?, although I imagine that they are very > close to the same. > > I think that it just depends on what you prefer between the first two > options you gave. ;-) > > My 2� > --Ammon > > > ----- Original Message ----- > From: "Gregg Irwin" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, November 09, 2001 2:44 PM > Subject: [REBOL] Best way to alias words > > > > This is two part question: > > > > Technically, is there a "best" way to define word aliases (the main > > consideration being efficiency)? > > > > From a design perspective what's best for clarity, and ease of > maintenance? > > This is highly subjective of course. > > > > The candiates are: > > > > ;-- Multiple assignment > > obj: context [ > > ?: help: does [ > > print "Help...coming soon" > > ] > > ] > > > > ;-- Explicit value setting > > obj: context [ > > ?: does [ > > print "Help...coming soon" > > ] > > help: :? > > ] > > > > ;-- Using 'alias (can be used before or after routine definition) > > obj: context [ > > alias '? "help" > > ?: does [ > > print "Help...coming soon" > > ] > > ] > > > > The last alternative makes it *very* clear what your intent is, and may > also > > be the most efficient, but I hit a little snag with my example and I'm not > > sure why: > > > > ** Script Error: Alias word is already in use: help > > ** Where: context > > ** Near: alias '? "help" > > > > I haven't figured out what the rules are that cause it to fail. "help" and > > "x" fail, but "xx" and "help-me" work just fine. Does anyone know if alias > > checks against system words for conflicts, not taking the context into > > account? > > > > Let me know what you think, or if you're totally against alias'ing in any > > form. > > > > Thanks! > > > > --Gregg > > > > -- > > 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.
