Re: RfD: SYNONYM




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

.



Relevant Pages

  • Re: RfD: SYNONYM
    ... Win32Forth already supports SYNONYM with the same syntax. ... VOCABULARY NEWVOC ...
    (comp.lang.forth)
  • Re: RfD: SYNONYM
    ... Win32Forth already supports SYNONYM with the same syntax. ... VOCABULARY NEWVOC ...
    (comp.lang.forth)
  • Re: RfD: SYNONYM
    ... Win32Forth already supports SYNONYM with the same syntax. ... SYNONYM TEST TEST (make alias in new vocab) ... of the original) to have the same word in diffrent vocabularies many a ...
    (comp.lang.forth)
  • Re: RfD: SYNONYM
    ... Win32Forth already supports SYNONYM with the same syntax. ... SYNONYM TEST TEST (make alias in new vocab) ... of the original) to have the same word in diffrent vocabularies many a ...
    (comp.lang.forth)
  • Re: RfD: SYNONYM
    ... Win32Forth already supports SYNONYM with the same syntax. ... SYNONYM TEST TEST (make alias in new vocab) ... of the original) to have the same word in diffrent vocabularies many a ...
    (comp.lang.forth)