One and One doesn't equal two It equals 1 - The Who 
Author Message
 One and One doesn't equal two It equals 1 - The Who


Quote:

>Sorry, but any Scheme or Lisp I know of will complain that '1' is not a symbol.

>Markus

Indeed...    But, Forth will let you do it...   (I just LOOOVE that!   ;)
(I've tried it on my copy of TransLISP- it don't like it at *ALL*...)

Frank C. Earl



--->  Starflight and Starflight II are successful PC and MAC games  <---
--->  that have been written in Forth!!!       (So, there!  ;)      <---



Sat, 11 Sep 1993 06:24:14 GMT  
 One and One doesn't equal two It equals 1 - The Who

Quote:

>>Sorry, but any Scheme or Lisp I know of will complain that '1' is not a symbol

>Indeed...    But, Forth will let you do it...   (I just LOOOVE that!   ;)

   The Forth philosophy seems to be that everything read in is a WORD.
   Upon reading "1" and not finding an entry in the dictionary, the
   'default` action of "1" is performed.  Namely, to push the value 1
   on the stack.  This is consistent with Forth's refusal to acknowledge
   there are varied types of data.  The interpreter refuses to read
   anything other than WORDs.

   Lisp simply has a different philosophy.  Lisp is typed.  The reader
   returns the value 1 when it sees "1", rather than the symbol who's
   name is "1".  The reader returns a vector when it sees #() and a list
   when it sees '().  To have the reader return the symbol who's name is
   "1", the syntax (oh, no, that swear word again) is |1|.  In lisp, (I
   am really talking only CL here, don't know how Scheme does it), I
   could thus say (defun |1| () 2) or (setq |1| 2) without error.

   Notice Forth would need a special syntax to distinguish numbers and
   names of numbers if its search order were changed.  ie. Check if the
   string is a number first, if not, search in the dictionary.

   I have accidentally redefined a constant in fortran before.  One did
   (do? depends on the implementation I guess) this by calling a subroutine
   with a constant argument.  Since FORTRAN passes arguments by address...
   This is a tough bug to find!  However, I find it hard to believe anyone
   could accidentally do this in Forth.  If you did misstype the name to a
   colon definition, it would be an easy bug to spot.

   You can love or hate that Forth allows you to do this.  It is novel but
   potentially dangerous.  What I dislike is the philosophy of Forth that
   makes it possible to allow you to do it. 8^)  But you know that already.
--



Mon, 13 Sep 1993 04:38:29 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. One and One doesn't equal two It equals 1 - The Who

2. Synchronising App from one dct in a not equal other

3. A doesn't equal B, but B=A

4. colon-equal vs equal

5. How to replace one or two words with one word with one line of awk code

6. Writing two equal files without creating two files in dct

7. Writing two equal files at once

8. Problem with two Pipes, one for STDOUT and one for STDERR

9. Blt 2.3: One Bug, One Feature, Two Solutions :)

10. Two One bug, one RFE in Tk4.0

11. How To make '(--a) equals 'a

12. See one, do one, teach one...

 

 
Powered by phpBB® Forum Software