Search found 18 matches
- Wed Dec 29, 2010 10:00 pm
- Forum: Common Lisp
- Topic: When is 'require' required?
- Replies: 4
- Views: 5075
Re: When is 'require' required?
The problem you encountered with REQUIRE, which would actually be the same if you included ASDF/Quicklisp loading function directly in the file, is because they are functions. It would work if you LOADed the file, which evaluates expressions in the file one by one, but compilation just compiles the...
- Sat Dec 25, 2010 10:11 pm
- Forum: Common Lisp
- Topic: When is 'require' required?
- Replies: 4
- Views: 5075
When is 'require' required?
Hello all! I've been away from this board for some time. Last time, I was in the middle of learning lisp by reading PCL. I had gotten about 2/3 of the way through, before I realized that I didn't really like the style of the book. So I switched to Paul Graham's ACL, and worked through all the exerci...
- Mon Jul 26, 2010 3:13 am
- Forum: Common Lisp
- Topic: Simple polymorphism in Common Lisp
- Replies: 12
- Views: 23369
Re: Simple polymorphism in Common Lisp
Also CLOS is rather different from most object system, being verb centered rather than noun centered, which I have always found to be a nice compromise between functional and object styles, as long as one is able to think in terms of those verbs, and protocols, rather than primarily focusing on cla...
- Mon Jul 26, 2010 2:53 am
- Forum: Common Lisp
- Topic: Image-based development in Lisp
- Replies: 5
- Views: 6077
Image-based development in Lisp
When programming in Smalltalk, one finds that the image is ubiquitous. Most Smalltalk programmers keep many different images around on their computer--- often for years---returning to work on an image whenever its suits them. Indeed, one usually starts up Smalltalk by selecting and dragging a partic...
- Wed Jul 07, 2010 1:01 am
- Forum: Common Lisp
- Topic: Simple polymorphism in Common Lisp
- Replies: 12
- Views: 23369
Re: Simple polymorphism in Common Lisp
Common Lisp is not a functional language, it is a multiparadigm one. This allows it to fit to almost any problem domain without jumping through ridiculous hoops, although some rarer paradigms would require bolting on a library, which might or might not be already available. Granted. However, certai...
- Mon Jul 05, 2010 4:21 pm
- Forum: Common Lisp
- Topic: Persisting data in hash table to and from disk
- Replies: 7
- Views: 12368
Re: Persisting data in hash table to and from disk
I had thought it a little strange that the PRINT function would work for structs and plists, but not for hashtables. PRINT function does work for hashtables, it just prints an unreadable representation. There is no technical reason for this. The standard leaves this decision to the implementations,...
- Mon Jul 05, 2010 4:02 pm
- Forum: Common Lisp
- Topic: Simple polymorphism in Common Lisp
- Replies: 12
- Views: 23369
Re: Simple polymorphism in Common Lisp
Correct me if I'm wrong, but I gather that generic functions only work with objects defined by defclass, but not ordinary structures. You are wrong ;-). CLOS is not something bolted on Common Lisp, but an integral part of it. Every first class entity belongs to some class, which is easily checked b...
- Mon Jun 28, 2010 5:49 am
- Forum: Common Lisp
- Topic: Simple polymorphism in Common Lisp
- Replies: 12
- Views: 23369
Re: Simple polymorphism in Common Lisp
Thanks for both of your comments. I've skipped ahead a bit to chapter 16 in PCL to read further on generic functions. They do seem very powerful. Correct me if I'm wrong, but I gather that generic functions only work with objects defined by defclass, but not ordinary structures. When I was reading C...
- Mon Jun 28, 2010 5:17 am
- Forum: Common Lisp
- Topic: Persisting data in hash table to and from disk
- Replies: 7
- Views: 12368
Re: Persisting data in hash table to and from disk
Sorry for my late reply. It's been a busy past week, and I've had several things to attend to before I could take up Lisp again. Is there a way to make this work in Common Lisp, short of manually iterating through the contents of the hash table and printing each key and value: What other solution wo...
- Tue Jun 22, 2010 3:19 am
- Forum: Common Lisp
- Topic: Persisting data in hash table to and from disk
- Replies: 7
- Views: 12368
Persisting data in hash table to and from disk
In Practical Common Lisp, p. 25, is a SAVE-DB function for a sample CD database which writes the contents of the database to disk, so that they can be read back in again. (defun save-db (filename) (with-open-file (out filename :direction :output :if-exists :supersede) (with-standard-io-syntax (print...