How do you link up the BNF definition with the parse statement?
I can't seem to find any simple examples. Thanks!

REBOL [
 Title: "Differentiator"
         Purpose: {
         differentiates an algebraic function
         differentiate "x**2"    returns "2*x**1"
         }
]

differentiate: function [str [string!]] [result]  [
result: ""

factor:  ["x**" digit]
digit:   charset "0123456789"

   parse str [
    factor (result: join result  [ digit "*x**"  digit - 1 ]  )  ;this
doesn't work
   ]

   return result
]

print [differentiate "x**2"]

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, February 06, 2000 3:25 AM
Subject: [REBOL] Re: [Rebol_New] symbol manipulation


> [EMAIL PROTECTED] wrote (on Rebol_New):
> > I'd like to learn how to do symbolic differentiation and parse roman
> numerals to get arabic numbers. I've read the docs, but nothing sinks in.
I
> believe I need to use the dialog method. Does anybody know how to do
these?
>
> My rather boring Roman numerals converter implementation is attached.
>
> Andrew Martin
> Partying like it's MIM...
> ICQ: 26227169
> http://members.xoom.com/AndrewMartin/
> -><-
>
>
> --
>
> Unlimited Internet Access only $12.95 a month! http://www.peclink.net/

--

Unlimited internet access only $12.95 a month. Click here for more details: 
http://www.surfcheap.com/?allied

Reply via email to