lisp- type checking?

Please support our Legacy and Other Languages advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Apr 2008
Posts: 1
Reputation: lastcylon is an unknown quantity at this point 
Solved Threads: 0
lastcylon lastcylon is offline Offline
Newbie Poster

lisp- type checking?

 
0
  #1
Apr 3rd, 2008
hi, i was wondering if there are functions in lisp that lets me check if an object or defstruct object is certtain defstruct object

as if
if i have

(defstruct (firstthing (:conc-name nil)) first second)
(defstruct (somethingelse (:conc-name nil)) blah blah)

and i instanciated

(setf thing (make-firstthing :first '(a) :second '(b)))

how do i check if thing is an instance of firstthing or somethingelse?
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 36
Reputation: azimuth0 is an unknown quantity at this point 
Solved Threads: 5
azimuth0 azimuth0 is offline Offline
Light Poster

Re: lisp- type checking?

 
0
  #2
Apr 4th, 2008
(typep thing 'first) will do what you want.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Legacy and Other Languages Forum
Thread Tools Search this Thread



Tag cloud for Legacy and Other Languages
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC