Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Scheme Programming Language

delay with memorization confusion.


hi

Where do I put memo-proc? In the "interpreted space" or "interpreter
space"? Both choices seem confusing to me.
If the interpreter was already applicative, how can the same
expression gets applied more than once?

(define (memo-proc proc)
  (let ((already-run? false) (result false))
    (lambda ()
      (if (not already-run?)
          (begin (set! result (proc))
                 (set! already-run? true)
                 result)
          result))))

On Apr 2, 4:57 pm, dillog@gmail.com wrote:

> hi

> Where do I put memo-proc? In the "interpreted space" or "interpreter
> space"? Both choices seem confusing to me.
> If the interpreter was already applicative, how can the same
> expression gets applied more than once?

> (define (memo-proc proc)
>   (let ((already-run? false) (result false))
>     (lambda ()
>       (if (not already-run?)
>           (begin (set! result (proc))
>                  (set! already-run? true)
>                  result)
>           result))))

Ok, got it working, it's in interpreted namespace.
Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc