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


Groups > comp.lang.forth > #10738

Backquoted Macros

From Helmar Wodtke <helmwo@gmail.com>
Newsgroups comp.lang.forth
Subject Backquoted Macros
Date 2012-03-29 08:29 -0700
Organization http://groups.google.com
Message-ID <21091167.276.1333034944725.JavaMail.geo-discussion-forums@yneo2> (permalink)

Show all headers | View raw


Hi,

I'm working on some documentation to my Forth system (forth4p) and came across the nice invention of "Backquoted Macros" from FreeForth again.

Does anyone else than FreeForth and my Forth use this?

It's very practical:

: 2dup` over` over` ;

could be a definition of 2dup. The backquote at colon-definition name means more or less the thing is "IMMEDIATE" and inside code it means more or less to "POSTPONE" the word. So similar thing in "Forth 94" would look like:

: 2dup postpone over postpone over ; immediate

The nice thing about it is that you see if a word is immediate right after colon. The other nice thing is that you have much less space consumed than to write "POSTPONE". Actually neither forth4p nor FreeForth use the quirky semantics of "POSTPONE" if it comes to STATE (FreeForth does not even have this if I remember right).

Maybe this concept is interesting for others - look at FreeForth page for the original: http://christophe.lavarenne.free.fr/ff/
HelFORTH and forth4p also implement a backquote in front of a word, which is similar (well, "about similar") to something like ['] name.


Regards,
-Helmar

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


Thread

Backquoted Macros Helmar Wodtke <helmwo@gmail.com> - 2012-03-29 08:29 -0700
  Re: Backquoted Macros Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-04-03 09:33 +0000
    Re: Backquoted Macros Mark Wills <markrobertwills@yahoo.co.uk> - 2012-04-03 06:46 -0700
  Re: Backquoted Macros Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-04-03 03:32 -0700
  Re: Backquoted Macros BruceMcF <agila61@netscape.net> - 2012-04-03 17:02 -0700

csiph-web