[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gforth] noname and :noname

From: Carlos Pita
Subject: [gforth] noname and :noname
Date: Thu, 4 Feb 2010 13:22:30 -0300


recently I've implemented (for learning purposes, above all) a curry ( x xt -- xt' ) word with the obvious partial evaluation semantics. So you can do: 2 5 ' + curry execute . ==> 7.

I was able to implement the above word in both ans-standard and non-standard ways. The standard way gets advantage of :noname to create the currified xt, something like: : curry :noname ... postone ; ; . The non-standard uses the noname gforth extension. But they're not quite equivalent in the sense that the first explicitly postpones compilation of this and that while the second one, after calling create, just defines the runtime behavior of curry in plain forth by means of does>.

 At this point I realized that there's a kind of asymmetry in the standard as long as it omits a construction like -say- create-noname. You have the tandem of named and nonamed colon definitions, but there isn't anything like create-noname when the time comes to create a defining word (in this case, curry) using the typical create ... does> sequence (and ans *requires* does> to be used in combination with create).

Well, gforth has noname and I've seen that strongforth has create-noname, so my opinion may have some foundation after all, I think. Now I'm asking you forth implementors whether you know of some rationale for that omission or not. Why do you think it's not desirable to CREATE a "nonamed xt" from ans forth perspective ?

Kind regards

reply via email to

[Prev in Thread] Current Thread [Next in Thread]