On 21 Dec 2011, at 13:10, Meikel Brandmeyer wrote:

> Hi,
> 
> Am 21.12.2011 um 13:56 schrieb Sam Aaron:
> 
>> One approach to achieving that is to create a special type which represents 
>> the data and for which you also override the print-method.
> 
> A simple approach is a get-option-info and a print-option-info. Toolsmiths 
> use get-option-info to get the data structure while REPL users use the 
> show-options which feeds the output of get-option-info into print-option-info.
> 
> Seems less involved than a new type. ;)

That makes a lot of sense. I was just having fun - we can do things like:

;; print a list of all files which contain the string "foo" that are on the 
desktop:
(grep (ls "~/Desktop") "foo") 

But if you're not passing this around and wanting it to be be both a useful 
datastructure and also something the nicely prints itself, having multiple fns 
as Meikel suggests is clearly a simpler an nicer approach :-)

Sam

---
http://sam.aaron.name

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to