Subject: Strange

From: Owen Brand <[email-masked]>
Date: Sat, 10 Apr 2010 16:21:28 -0400

58 LOAD returned "ok" so that's good.. But I am trying to define a new  
word called "CHICKEN".  Basically I just want it to print "I AM A  
CHICKEN" on the screen.  Following Brodies examples, here's the syntax  
I used to define the word

: CHICKEN ."I AM A CHICKEN" ;

According to this rehashed text i've been reading, the "." in front of  
the quotes tells Forth to print the quoted text on the screen, and  
then the semicolon closes the word definition. It did not work and  
kicked out an error... --> ."I ?

  So, to test it out, I defined the word "ADD" like this:

: ADD + . ;

It prompts "ok".  So I add 4 and 5 to the stack like so...

4 5 (enter)

Then by typing "ADD" it returns "9" which is perfect.  I tried  
different variations of "CHICKEN" to see if it expected a different  
syntax.  It continues to return ? messages...

: CHICKEN ."I AM A CHICKEN" ;
*returns--> ."I ?

: CHICKEN . "I AM A CHICKEN" ;
*returns--> "I ?

: CHICKEN "I AM A CHICKEN" . ;
*returns-->  "I ?

So--- either I'm typing something in incorrectly, the book I'm reading  
is screwy, or doing the 58 LOAD didn't set up the Forth to run it  
exactly like what's in the book.  Sorry, I'm missing the PDF for  
WYCOVE 2.0--- I DLed it from WHT but when I transferred it to my PC  
from the MAC terminal I was on via thumb drive, it became corrupted  
and won't read.  Any help ideas?  Thanks!!

Owen Brand
Opry99er.com

---

From: "Tursi" <[email-masked]>
Date: Sat, 10 Apr 2010 13:27:51 -0700

I know you'll get better descriptions - but when you hit bugs like that in 
Forth, think about the state of the stack.

For instance, when you run add, you do this:

4 5 (enter)   (stack: 4, 5)
Add (enter) (stack: 4, 5)
(add does +, which adds the top two numbers on the stack) (stack: 9)
(add does ., which prints the top thing on the stack - it prints 9) (stack: 
empty)

Try that exercise with Chicken :) (remember that '.' is a separate command 
in itself).

--------------------------------------------------
From: "Owen Brand" <[email-masked]>
Sent: Saturday, April 10, 2010 1:21 PM
To: <[email-masked]>; <[email-masked]>
Subject: [TI994A] Strange

> ------------------------------------
>
> Yahoo! Groups Links
>
>
>

---

From: Owen Brand <[email-masked]>
Date: Sat, 10 Apr 2010 16:51:49 -0400

I see what I did here...

."I AM A CHICKEN"

should be

." I AM A CHICKEN "

In Forth, quotation marks do not work as they do in English or in XB.   
The first one tells Forth that you are defining a string, the second  
quotation mark is a delimiter.  They must be separated by a space, as  
they are words in and of themselves.  :). Cool!!!

Ahhh, this is fun.

Owen Brand
Opry99er.com

---

From: Owen Brand <[email-masked]>
Date: Sat, 10 Apr 2010 16:56:54 -0400

Actually, ." is a word-- it compiles the string and transmits the text  
to whatever output device you select... In this case, the screen.

Owen Brand
Opry99er.com

On Apr 10, 2010, at 4:51 PM, Owen Brand <[email-masked]> wrote:

> I see what I did here...
>
> ."I AM A CHICKEN"
>
> should be
>
> ." I AM A CHICKEN "
>
> In Forth, quotation marks do not work as they do in English or in  
> XB.  The first one tells Forth that you are defining a string, the  
> second quotation mark is a delimiter.  They must be separated by a  
> space, as they are words in and of themselves.  :). Cool!!!
>
> Ahhh, this is fun.
>
>
>
> Owen Brand
> Opry99er.com
>

---

From: mark wills <[email-masked]>
Date: Sun, 11 Apr 2010 07:18:44 +0000 (GMT)

>They must be separated by a space, as they are words in and of 
themselves.

Correct. THERE IS NO SYNTAX IN FORTH.

." is just another word. Without the space, Forth looks in it's dictionary for a word called ."I 

Simple, huh?

M

>
>From: Owen Brand <[email-masked]>
>To: "[email-masked]" <[email-masked]>
>Sent: Sat, 10 April, 2010 21:51:49
>Subject: Re: [TI994A] Strange
>
> >
>
>
>
> >
>
>
>
>
>
>
>I see what I did here...
>
>
>."I AM A CHICKEN" 
>
>
>should be
>
>
>." I AM A CHICKEN "
>
>
>In Forth, quotation marks do not work as they do in English or in XB.  The first one tells Forth that you are defining a string, the second quotation mark is a delimiter.  They must be separated by a space, as they are words in and of themselves.  :). Cool!!!
>
>
>Ahhh, this is fun.
>
>
>
>
>Owen Brand
>Opry99er.com
>
>On Apr 10, 2010, at 4:27 PM, "Tursi" <[email-masked]> wrote:
>
>
>>>
>>
>>
>>  >>
>>
>> 
>>>>      
>> 
>>>>------------ --------- --------- --------- --------- --
>>>>From: "Owen Brand" <owenbrand@opry99er. com>
>>>>To: <rmcarmany@aol. com>; <TI994A@yahoogroups. com>
>>>>> ------------ --------- --------- ------
>>>>>
>>>>> Yahoo! Groups Links
>>>>>
>>>>>
>>>>>
>>
>
>
>