Re: RfD: SYNONYM
- From: "Alex McDonald" <alex_mcd@xxxxxxxxxxxxxxx>
- Date: 24 Aug 2006 04:04:05 -0700
Ed wrote:
"George Hubert" <georgeahubert@xxxxxxxxxxx> wrote in message
news:1156177696.845015.227430@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Stephen Pelc wrote:
RfD - Synonyms
...
The syntax is:
SYNONYM <newname> <oldname>
where <newname> will behave identically to <oldname>.
Note that <newname> may be the same as <oldname>.
...
Win32Forth already supports SYNONYM with the same syntax.
Not so fast :)
I wonder how many missed the part in the spec about making
aliases with the same name!
A conforming SYNONYM should be able to handle this:
\ Test SYNONYM ability to make alias with same name
CR
FORTH ALSO DEFINITIONS
: TEST ." hello " ;
VOCABULARY NEWVOC
NEWVOC DEFINITIONS
SYNONYM TEST TEST ( make alias in new vocab )
CR .( now testing alias ) CR
NEWVOC TEST
You're right; Win32Forth fails this test due to a timing issue creating
the dictionary entry. At the point where SYNONYM is executed, the ORDER
is
order
Context: NEWVOC FORTH FORTH ROOT
Current: NEWVOC ok
TEST is being defined, then searched for, rather than searched for then
defined; so it finds itself rather than the TEST in the FORTH
vocabulary. WIll be corrected.
--
Regards
Alex McDonald
.
- Follow-Ups:
- Re: RfD: SYNONYM
- From: George Hubert
- Re: RfD: SYNONYM
- References:
- RfD: SYNONYM
- From: Stephen Pelc
- Re: RfD: SYNONYM
- From: George Hubert
- Re: RfD: SYNONYM
- From: Ed
- RfD: SYNONYM
- Prev by Date: Re: RfD - Enhanced local variable syntax (long)
- Next by Date: Re: RfD: SYNONYM
- Previous by thread: Re: RfD: SYNONYM
- Next by thread: Re: RfD: SYNONYM
- Index(es):
Relevant Pages
|