scheme2lisp::define function and pass it as parameter

Posted by Stas on Stack Overflow See other posts from Stack Overflow or by Stas
Published on 2010-05-28T20:50:04Z Indexed on 2010/05/28 21:22 UTC
Read the original article Hit count: 255

Hi! Im need translate some code from scheme to common lisp. Now I have something like this

(defun sum (term a next b)
 (if (> a b)
  0
  (+ (term a) (sum term (next a) b))))
(defun sum-int (a b)
 (defun (ident x) x )
 (sum ident a 1+ b))

But it doesn't interprete with out errors.

* - DEFUN: the name of a function must be a symbol, not (IDENT X)

Help me plese. Thanks

© Stack Overflow or respective owner

Related posts about function

Related posts about functional-programming