Tuesday 15 September 2015

lisp - Is there a shorter way to write a function applied to a list in scheme like this? -


I'm using R5RS (in rackets) here my example is

  ( Map (Lambda (X) (list (+ + apply) (apply * x)) ((1 2 3) (4 5 6)) ->   

I Just wondering if such an underlying task is

  (Apply map '(+ *)' ((1 2 3) (4 5 6)))  < / Pre> 

which can produce the same result.

Nothing is built in , But you can write your own:

  (definition (Apply fax code) (map (lambda) (item) (map fax) (fax) (apply fax items))) item))   

> (List + *), , no '(+ *) , though.

No comments:

Post a Comment