🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.forth.mac
2 messages
2 total messages Started by Thomas W. Scroggins Wed, 16 Dec 1992 11:26
RECURSION?!?
#33
Author: Thomas W. Scroggins
Date: Wed, 16 Dec 1992 11:26
13 lines
1194 bytes
I am just starting out using Forth and was wondering if MacForth allows
recursion and if anyone has examples if it does.

-- 
-------------------------------------------------------------------------------
|  ____________  ______   ___  ___       |Tom Scroggins - SCROGGINSTOM@BVC.EDU|
| /____   ____/ /     /  /   /    /      | Buena Vista College Storm Lake, Ia |
|     /  /     /  /  /  /  /  /  /       |------------------------------------|
|    /  /     /  /  /  /  /__/  /        |                                    |
|   /__/     /_____/  /__/  /__/         |            this space is	      |
|--------------//------------------------| reserved for future implementation |
| A bug is just an undocumented feature! |                                    |
-------------------------------------------------------------------------------
Re: RECURSION?!?
#34
Author: Anthony E Bible
Date: Wed, 16 Dec 1992 15:15
19 lines
938 bytes
In article <1992Dec16.052611.3031@peanut> scrogginstom@bvc.edu (Thomas W. Scroggins) writes:
>I am just starting out using Forth and was wondering if MacForth allows
>recursion and if anyone has examples if it does.
>
>-- 

Tom:
	Yes it does.  Here is an example (factorial -- what else :):

: FACTORIAL  ( n1 -- n2)	\ return n1 factorial
   ?DUP IF  DUP 1-  MYSELF *  ELSE  1  THEN ;


	As you can probably tell, MYSELF invokes the word which is being
compiled, i.e., it recurses.


Regards,
tony
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads