Post Reply 
[Forth] Derivative "Eight"
08-26-2023, 01:46 PM (This post was last modified: 08-26-2023 01:54 PM by Joe Horn.)
Post: #3
RE: [Forth] Derivative "Eight"
Wow, 8th looks so close to RPL that learning it should be easy for RPL afficionados, especially those who have ever dabbled with System RPL. Check out this sample of 8th code:

Code:
\ Find the sum of all the multiples of 3 or 5 below 1000.

with: n
: div? \ n m -- f
  mod not ;

: sum-multiples \ sum x -- sum'
    dup 3 div?
    over 5 div?  or 
  if + else drop then ;

0 ' sum-multiples 3 999 loop . cr bye

<0|ΙΈ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
[Forth] Derivative "Eight" - floppy - 08-26-2023, 12:30 PM
RE: [Forth] Derivative "Eight" - Joe Horn - 08-26-2023, 01:48 PM
RE: [Forth] Derivative "Eight" - Joe Horn - 08-26-2023 01:46 PM



User(s) browsing this thread: 2 Guest(s)