Prev: Black-Jewish History FAQ - Is The Secret Relationship between blacks and jews a “hate literature”?
Next: which library to generate xml with namespaces?
From: Captain Obvious on 18 Jun 2010 18:43 BF> You're arguing about LOC, Ron is arguing about correct abstraction. By the way, why do we abstract out hash-table but leave the list alone? I don't think it is correct. Code needs to work with any enumerable data container, not only lists, otherwise it will be half-assed and abstractions won't be correct. So I think we need to create a class for abstract data containers and some enumeration functions on it (like foldl) so we can do this properly.
From: Bob Felts on 18 Jun 2010 23:05 Captain Obvious <udodenko(a)users.sourceforge.net> wrote: > BF> You're arguing about LOC, Ron is arguing about correct abstraction. > > There is no such thing as a "correct abstraction." > If code works, it is correct. I know someone who would like to disagree with you. Perhaps she will be familiar to you? http://stablecross.com/files/Software_Plea_1.html Correctness is much, much more than just "it works". > Otherwise, we can put a shitload of abstractions on top of it -- but will it > make it better? Too much abstraction is as bad as too little abstraction is as bad as the wrong abstraction.
From: Bob Felts on 18 Jun 2010 23:05 Marcus Breiing <usenet(a)2010w24.mail.breiing.com> wrote: > * Bob Felts > > > You're arguing about LOC, Ron is arguing about correct abstraction. > > Read Chapter 18.1.1 of the CLHS: The CL hash-table itself is an > abstraction. So are integers, and complex numbers, b-trees and... Maybe complex numbers could be used. It's an abstraction. [...] > > Piling complication on top of this simple abstraction could make sense > in the context of advanced application design, but is it good > paedagogy for beginners? Absolutely. In my opinion, one's first introduction to computers should be about problem representation and abstraction of problem elements, only then to be followed by programming languages. A well-written story with incoherent plotting and dull characters won't sell much, unless the special effects are great and/or you're resting on your reputation.
From: Wade on 19 Jun 2010 00:29 Sorted lists are your friend (defun count-sorted-list (list) (when list (let ((element (car list)) (n 1)) (loop for next on (cdr list) while (eql element (car next)) do (incf n) finally (return (cons (cons element n) (count-sorted-list next))))))) (defun count-list (list) (sort (count-sorted-list (sort (copy-list list) #'string<)) #'> :key #'cdr)) CL-USER> (count-list '(a b c f g a a c c a b )) ((A . 4) (C . 3) (B . 2) (F . 1) (G . 1)) CL-USER> Wade
From: Eric Wolf on 19 Jun 2010 04:12
That's just gorgeous! Thanks for all the replys! I will need some time to read (and understand) them all. Yours sincerely, Eric |