impc:ti:lambda   scheme


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/runtime/llvmti.xtm

Implementation

;; no anonymous lambdas !!!
(define impc:ti:lambda
  (lambda (ast)
    (set! *anonlambdanum* (+ 1 *anonlambdanum*))
    (let* ((fname (string->symbol (string-append "_anon_lambda_" (number->string *anonlambdanum*))))
           (rest (cons (impc:ti:first-transform (cadr ast) #t)
                       (list (cons 'begin (impc:ti:first-transform (cddr ast) #t)))))
           ;;(expr (cons 'lambda rest)))
           (expr (cons (car ast) rest)))
      `(let ((,fname ,expr))
         (begin ,fname)))))


Back to Index

Similar Entries