I was reading a blog post by Robert Smith on
ideas for future directions for Lisp type systems, where Robert mentioned the following trick to enforce provision of required slot values for structures and classes:
(defstruct foo
(slot1 (error "Must provide value for slot1")))
That's something I haven't thought of doing before, I hope you find it useful as well. The rest of Robert's article is well worth a read.
No comments:
Post a Comment
Hi there! Thanks for taking the time to comment on my blog. To avoid spam, all messages are personally reviewed by me prior to being posted - don't worry if your message does not show up right away.
Note: Only a member of this blog may post a comment.