Am 02.07.2008 um 00:09 schrieb Slava Pestov:
How would we distinguish between a typed and untyped definition in
this case?
Slava
On Tue, Jul 1, 2008 at 4:58 PM, Fernando Alava <[EMAIL PROTECTED]
> wrote:
What about this?
: nth ( integer array -- elt ) ... ; ! StrongForth-like
The words integer and array are previously defined as valid types.
But what if elt is later defined later as a type?
And if you don't need types you can always write:
: nth ( i a -- elt ) ... ; ! Untyped definition
Again this only works unless somebody lazy enought to use one char
long names for his types defines them in the same vocabulary breaking
code he didn't modifiy.
I think you don't need to specify both i and integer if later you
can't
use i as a local variable inside the word definition.
: mod ( integer integer -- integer ) ... ;
Is non commutative and all inputs and outputs are integers here
someone not knowning the order the paramerters are expected to be in
would benefit from a useful description.
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk