[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: In search of cool Scheme
From: |
Harvey J. Stein |
Subject: |
Re: In search of cool Scheme |
Date: |
24 May 2001 09:12:38 -0400 |
"Hans O. Lowe" <address@hidden> writes:
> Sometime on Wednesday, Harvey J. Stein wrote:
>
> > Don't forget to add in a macro to do:
> >
> > (let ((x 3) (u 4)) (eval (differentiate '(* x (sin u)))))
> >
>
> I didn't mean for it to be evaluation. The intent was to demonstrate
> simple symbolic manipulation--returning symbols as results, much like
> what Alejo shared.
My point is that you get to be able to evaluate the derivative at
specific points for free. In other languages you'd have to write an
evaluator to be able to use the symbolic derivative.
In scheme you just do something like (depending on your macro facility):
(define-macro (diff-fcn form . args)
`(lambda args ,(differentiate form)))
Then you can do:
(define fprime (diff-fcn '(* x (sin x))) x u)
(fprime 3 4)
--
Harvey Stein
Bloomberg LP
address@hidden
- Re: In search of cool Scheme, (continued)
- Re: In search of cool Scheme, Marius Vollmer, 2001/05/22
- Re: In search of cool Scheme, Michael Livshin, 2001/05/22
- Re: In search of cool Scheme, Alejandro Forero Cuervo, 2001/05/23
- Re: In search of cool Scheme, Hans O. Lowe, 2001/05/23
- Re: In search of cool Scheme, Dirk Herrmann, 2001/05/24
Re: In search of cool Scheme, Klaus Schilling, 2001/05/22
- Re: In search of cool Scheme, Hans O. Lowe, 2001/05/22
- Re: In search of cool Scheme, Hans O. Lowe, 2001/05/23
- Re: In search of cool Scheme, Harvey J. Stein, 2001/05/23
- Re: In search of cool Scheme, Hans O. Lowe, 2001/05/23
- Re: In search of cool Scheme,
Harvey J. Stein <=
- Re: In search of cool Scheme, Harvey J. Stein, 2001/05/24
- Re: In search of cool Scheme, Hans O. Lowe, 2001/05/24
Re: In search of cool Scheme, Alex Shinn, 2001/05/22