For Programmers: Free Programming Magazines  


Home > Archive > Scheme > March 2004 > Scheme idiom or Scheme extension?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Scheme idiom or Scheme extension?
Marco Antoniotti

2004-03-27, 12:25 am

Hi

I was going through Sussman's "Structure and Implementation of Classical
Mechanics" (http://www-swiss.ai.mit.edu/~gjs/69...html/index.html)
and came upon the following idiom:

(define ((L-free-particle mass) local)
(let ((v (velocity local)))
(* 1/2 mass (dot-product v v))))

AFAIK this ain't R^nRS. What is the semantics of the above? I tried to
look around nearby links, but then I decided it'd be easier just to ask.

Cheers

marco

Jean-François Trevien

2004-03-27, 12:25 am


"Marco Antoniotti" <marcoxa@cs.nyu.edu> a écrit dans le message de
news:CW%5c.105$IJ5.80720@typhoon.nyu.edu...
> Hi
>
> I was going through Sussman's "Structure and Implementation of Classical
> Mechanics" (http://www-swiss.ai.mit.edu/~gjs/69...html/index.html)
> and came upon the following idiom:
>
> (define ((L-free-particle mass) local)
> (let ((v (velocity local)))
> (* 1/2 mass (dot-product v v))))
>
> AFAIK this ain't R^nRS. What is the semantics of the above? I tried to
> look around nearby links, but then I decided it'd be easier just to ask.
>

It has been in R3RS as far as i remenber. In R5RS it must be written:
(define (L-free-particle mass)
(lambda (local)
(let ((v (velocity local)))
(* 1/2 mass (dot-product v v)))))




Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com