Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #45270

SYNONYM question

From Gerry Jackson <gerry@jackson9000.fsnet.co.uk>
Newsgroups comp.lang.forth
Subject SYNONYM question
Date 2016-02-03 12:47 +0000
Organization A noiseless patient Spider
Message-ID <n8ssmo$aaa$1@dont-email.me> (permalink)

Show all headers | View raw


If we have:

1234 value x
synonym y x

Is this valid Forth?

9876 to y

Relevant bits of the Forth 2012 standard are:

6.2.2295 TO
"An ambiguous condition exists if name was not defined by a word with “TO
name run-time” semantics."

As y is defined by SYNONYM presumably the above is an ambiguous condition.

This seems wrong to me, after all one of the uses of SYNONYM is to 
redefine a word with the same name in a different wordlist and that, 
apparently cannot be done with VALUEs

Incidentally Gforth gives

1234 value x  ok
synonym y x  ok
9876 to y
:3: error: Invalid name argument
9876 to >>>y<<<

Having written the above, I just realised that exactly the same question 
applies to a SYNONYM of a deferred word and using IS on the synonym.

defer p
synonym q p
' some-def is q

Again Gforth rejects this, but does accept
' some-def ' q defer!
which works correctly.

If these uses of SYNONYM are ambiguous conditions then it makes SYNONYM 
less useful than it could be.

-- 
Gerry

Back to comp.lang.forth | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

SYNONYM question Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2016-02-03 12:47 +0000
  Re: SYNONYM question Mark Wills <markwills1970@gmail.com> - 2016-02-03 05:36 -0800
    Re: SYNONYM question stephen@mpeforth.com (Stephen Pelc) - 2016-02-03 15:36 +0000
      Re: SYNONYM question Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2016-02-03 17:26 +0000
        Re: SYNONYM question Bernd Paysan <bernd.paysan@gmx.de> - 2016-02-27 00:07 +0000
        Re: SYNONYM question hughaguilar96@gmail.com - 2016-02-26 18:44 -0800
      Re: SYNONYM question Mark Wills <markwills1970@gmail.com> - 2016-02-04 02:17 -0800
        Re: SYNONYM question Albert van der Horst <albert@spenarnc.xs4all.nl> - 2016-02-04 11:32 +0000
          Re: SYNONYM question stephen@mpeforth.com (Stephen Pelc) - 2016-02-04 17:12 +0000
      Re: SYNONYM question hughaguilar96@gmail.com - 2016-02-08 22:03 -0800
        Re: SYNONYM question Bernd Paysan <bernd.paysan@gmx.de> - 2016-03-03 00:09 +0000
          Re: SYNONYM question hughaguilar96@gmail.com - 2016-03-02 22:02 -0800
  Re: SYNONYM question anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-02-03 15:16 +0000
    Re: SYNONYM question Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2016-02-03 18:26 +0000
      Re: SYNONYM question Albert van der Horst <albert@spenarnc.xs4all.nl> - 2016-02-03 20:09 +0000
        Re: SYNONYM question Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2016-02-03 20:52 +0000
          Re: SYNONYM question "Elizabeth D. Rather" <erather@forth.com> - 2016-02-03 15:59 -1000
          Re: SYNONYM question Albert van der Horst <albert@spenarnc.xs4all.nl> - 2016-02-04 11:25 +0000
      Re: SYNONYM question Mark Wills <markwills1970@gmail.com> - 2016-02-04 02:16 -0800
        Re: SYNONYM question anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-02-04 11:18 +0000
      Re: SYNONYM question anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-02-04 10:54 +0000
        Re: SYNONYM question "HAA" <someone@microsoft.com> - 2016-02-04 23:35 +1100
  Re: SYNONYM question Albert van der Horst <albert@spenarnc.xs4all.nl> - 2016-02-03 19:48 +0000
    Re: SYNONYM question "HAA" <someone@microsoft.com> - 2016-02-04 11:07 +1100
    Re: SYNONYM question anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-02-04 11:08 +0000

csiph-web