why is this error message comming up? 
Author Message
 why is this error message comming up?

hi all..

the error message only comes up for the first use of function(map)
and it actually gives correct answer...
------------------
Warning: Function called with two arguments, but wants at least three.
(10 2.4 11.6 83)
------------------

(defun map (proc items)
  (if (null items)
      nil
    (cons (funcall proc (car items))
          (map proc (cdr items)))))

(map #'abs (list -10 2.4 -11.6 83))

thank you



Sat, 13 Nov 2004 09:37:37 GMT  
 why is this error message comming up?


Quote:
> hi all..

> the error message only comes up for the first use of function(map)
> and it actually gives correct answer...
> ------------------
> Warning: Function called with two arguments, but wants at least three.
> (10 2.4 11.6 83)
> ------------------

> (defun map (proc items)
>   (if (null items)
>       nil
>     (cons (funcall proc (car items))
>           (map proc (cdr items)))))

> (map #'abs (list -10 2.4 -11.6 83))

Because there's already a system defined function called MAP
and you are redefining it.  In your function application (MAP PROC ...)
the compiler thinks that you are calling the system supplied MAP.

P.



Sat, 13 Nov 2004 09:58:48 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. I am running a vi that crashes after a period of time with no error message

2. Why am I getting bind errors?

3. ERROR 48 - Why am I getting it?

4. why am i getting processor stack fault error?

5. why error message on this form code below

6. Lack of error messages during Tk startup - why?

7. Why is error message value "disappearing"?

8. Lack of error messages during Tk startup - why?

9. Error or notification pop-ups in Tk

10. why why why oh why why baby

11. I am not getting group messages

12. ERROR MESSAGE: Internal Error: tpsbt.cpp line 2172

 

 
Powered by phpBB® Forum Software