From: ·······@cad.strath.ac.uk
Subject: What's wrong with this code?
Date: 
Message-ID: <8sehfp$1b1$1@nnrp1.deja.com>
Hi, below code bunch is a part of Ecobweb.
I tried to load whole codes on MCL, and seems no problem except this one.
When I load below defun, MCL Listner gives me the error message as follow.

> Error: Too many arguments in (FUNCTION EXAMPLE CTREE).
> While executing: CCL::NX1-FUNCTION
> Type Command-. to abort.

The codes are as below.

(defun fill-missing-up-example (example ctree function &rest properties)
  (let* ((properties (if properties
			 (car properties)
			 (append *design-description* *specifications*)))
	 (prediction (funcall #'function example ctree))
	 (current (retrieve-node (node-name prediction) ctree))
	)
   (loop
	(let ((missing-properties
		(set-difference properties (class-properties-list prediction)))
	     )
	 (cond ( missing-properties
	         (dolist (property missing-properties)
		   (cond ((member property (class-properties-list current))
		          (push property (class-properties-list prediction))
		          (setf (class-property-seen property prediction) 1)
		          (change-property-value-node prediction property
			     (class-prop-val-most-probable property current))
			 )
		   ))
		 (if (eq (root ctree) (node-name current))
		     (return-from fill-missing-up-example prediction)
		     (setf current (retrieve-node (node-parent current)
						  ctree)))
	       )
	      ( t (return-from fill-missing-up-example prediction))
	 )			; end cond
	))))



I am a beginner of Common Lisp, so I can't find why this happen.
Anyone could help me?
Thanx.

Sungwoo


Sent via Deja.com http://www.deja.com/
Before you buy.

From: Rainer Joswig
Subject: Re: What's wrong with this code?
Date: 
Message-ID: <joswig-6D0F5B.11504316102000@news.is-europe.net>
In article <············@nnrp1.deja.com>, ·······@cad.strath.ac.uk 
wrote:

> > Error: Too many arguments in (FUNCTION EXAMPLE CTREE).
> > While executing: CCL::NX1-FUNCTION
> > Type Command-. to abort.
> 
> The codes are as below.
> 
> (defun fill-missing-up-example (example ctree function &rest properties)
>   (let* ((properties (if properties
> 			 (car properties)
> 			 (append *design-description* *specifications*)))
> 	 (prediction (funcall #'function example ctree))

I'd say the last line should be written as:

  (prediction (funcall function example ctree))

-- 
Rainer Joswig, Hamburg, Germany
Email: ·············@corporate-world.lisp.de
Web: http://corporate-world.lisp.de/
From: ·······@my-deja.com
Subject: Re: What's wrong with this code?
Date: 
Message-ID: <8settb$a79$1@nnrp1.deja.com>
It works. Thanx =)

Sungwoo


Sent via Deja.com http://www.deja.com/
Before you buy.