Re: defmethod with multiple parameters
- From: "Eric Lavigne" <lavigne.eric@xxxxxxxxx>
- Date: 9 May 2005 18:34:17 -0700
I made a mistake in my first post. I didn't notice that your call to
(set-background IMAGE)
worked correctly. Anyway, I think creating an optional argument will
still solve your problem. Something like this:
(defmethod combine (x y &optional (z 255))
(list x y z))
(combine 1 2 3) --> (1 2 3)
(combine 1 2) --> (1 2 255)
I don't know how to specify both a default value and a type
specification, though. Another possibility is to use (z integer),
accept the default value of z=nil, and add (if (null z) (setf z 255))
to the beginning of the method.
Good luck.
.
- Follow-Ups:
- Re: defmethod with multiple parameters
- From: Luke Crook
- Re: defmethod with multiple parameters
- References:
- defmethod with multiple parameters
- From: Luke Crook
- Re: defmethod with multiple parameters
- From: Eric Lavigne
- defmethod with multiple parameters
- Prev by Date: Re: defmethod with multiple parameters
- Next by Date: Re: defmethod with multiple parameters
- Previous by thread: Re: defmethod with multiple parameters
- Next by thread: Re: defmethod with multiple parameters
- Index(es):
Relevant Pages
|