The elusive DEFTYPE
Posted: Sat Aug 18, 2012 1:42 pm
Hi all,
I'm trying to broaden my understanding of the CL type system, and I was very surprised how little there is on (user-defined) types in Seibel's "Practical Common Lisp", Lamkin's "Successful Lisp" and Touretzky's "CL: A Gentle Introduction to Symbolic Computation". "DEFTYPE", for instance, doesn't even appear in the index of any one of them. CLtL2 and the Hyper Spec have plenty of info, but they're more reference works, obviously, and difficult to learn the basics from.
From what I've gathered so far, it seems like a really great compromise between static and dynamic typing - so I'm surprised it gets so little press.
I'm curious why this is - is it considered an advanced topic? Technically deficient? Not useful in practice? Or maybe not useful in many domains? Heck, it's not even in PG's "On Lisp".
My particular interest is in modelling 4-state logic (I'm a hardware guy), and I'm trying to figure out where to even begin - cons cells? class? struct? Seibel doesn't talk about DEFSTRUCT either.
Not asking for a tutorial, just would like to be pointed in roughly the right direction.
cheers,
~gareth
PS. Absolutely loving this journey so far, but man do I get lost sometimes. 27 years of programming imperatively, mostly in ALGOL-derived languages, sure narrows one's mind.
PPS. Which is why I've ended up here. I've never resorted to asking for help in any other programming language. I've really appreciated the kind and thoughtful responses I've had here.
I'm trying to broaden my understanding of the CL type system, and I was very surprised how little there is on (user-defined) types in Seibel's "Practical Common Lisp", Lamkin's "Successful Lisp" and Touretzky's "CL: A Gentle Introduction to Symbolic Computation". "DEFTYPE", for instance, doesn't even appear in the index of any one of them. CLtL2 and the Hyper Spec have plenty of info, but they're more reference works, obviously, and difficult to learn the basics from.
From what I've gathered so far, it seems like a really great compromise between static and dynamic typing - so I'm surprised it gets so little press.
I'm curious why this is - is it considered an advanced topic? Technically deficient? Not useful in practice? Or maybe not useful in many domains? Heck, it's not even in PG's "On Lisp".
My particular interest is in modelling 4-state logic (I'm a hardware guy), and I'm trying to figure out where to even begin - cons cells? class? struct? Seibel doesn't talk about DEFSTRUCT either.
Not asking for a tutorial, just would like to be pointed in roughly the right direction.
cheers,
~gareth
PS. Absolutely loving this journey so far, but man do I get lost sometimes. 27 years of programming imperatively, mostly in ALGOL-derived languages, sure narrows one's mind.
PPS. Which is why I've ended up here. I've never resorted to asking for help in any other programming language. I've really appreciated the kind and thoughtful responses I've had here.