Posts Tagged ‘Ruby’

March 11th, 2008

Confidence (2)

Tags:

One of my flaws when it comes to coding is lack of confidence, or you could call it lack of imagination.
At work we have some data files which are some funky binary format, readable only by some special program. This program has no command line interface. On a whim I thought […]

February 18th, 2008

RSS feed (Common Lisp) (2)

I made an RSS 2.0 feed for my origami gallery the other day. Thanks to CL-WHO this is trivial. Here’s the complete code:
;; RSS
(defun rss ()
(cl-who:with-html-output-to-string (s nil :prologue “<?xml version=\”1.0\” encoding=\”ISO-8859-1\” ?>”)
(:rss :version “2.0″ :|xmlns:atom| “http://www.w3.org/2005/Atom”
(:channel […]

February 15th, 2008

Lisp ramblings (14)

Tags: , , ,

Two posts in one, just because I can.
Rambling #1: One thing that makes a language like Ruby easy to read is that foo.bar always has the same meaning: object.method.
In Common Lisp you don’t have that. One of CL’s strengths is that everything looks the same, it’s all s-expressions. However a cost of this […]

February 6th, 2008

PAIP, review one of probably many (0)

Tags: , , , ,

I got through the first four chapters of PAIP yesterday and today. It’s good so far. I had reservations about spending $80 on a book, but it’s 950 pages and almost all of it is good stuff, from what I can see at a glance. Little space is wasted on introduction material […]

January 31st, 2008

PAIP; Lisp Lisp Lisp (13)

Tags: , , ,

I ordered PAIP today. Good computer books are so expensive. It hurts me to spend $80 on a book. But there are many worse ways to spend $80 than on something which contains so much knowledge, I guess. I got a $25 gift card for a book store for Christmas, so […]

January 28th, 2008

SBCL on Gentoo (rules) (4)

Tags: , , ,

The SBCL download page shows version 1.0.14 released today, and it’s already in Portage (masked). The gentoo-lisp list says we got a new Lisp project lead recently. Looks like there’s plenty of Lisp going on in the Gentoo world. Personally I am very pleased with the state of Lisp in Gentoo.
Sometimes I […]

January 10th, 2008

*sigh* (5)

Tags: , , ,

I spent four hours working on my photo-blog in Common Lisp that I’ve mentioned earlier.
Why does Common Lisp hate me? After four hours, I’m not yet even to the point where I can reliably, successfully load all the libraries I need to load. How pathetic is that? I haven’t even gotten to […]

December 20th, 2007

CLOS vs. Ruby (3)

Tags: , ,

I thought I sort of understood CLOS, until…
CL-USER> (defclass foo ()
((bar :initform "BAR" :accessor bar)))
 
#<STANDARD-CLASS FOO>
CL-USER> (defparameter *x* (make-instance ‘foo))
*X*
CL-USER> (bar *x*)
"BAR"
CL-USER> (defclass foo ()
((bar :initform "NEWBAR" :accessor bar)
(baz :initform "BAZ" :accessor baz)))
#<STANDARD-CLASS FOO>
CL-USER> (defparameter *y* (make-instance ‘foo))
*Y*
CL-USER> (bar *y*)
"NEWBAR"
CL-USER> (bar *x*)
"BAR"
CL-USER> (baz *y*)
"BAZ"
CL-USER> (baz […]

December 13th, 2007

False (1)

Tags: , , ,

In Ruby, the only things that are false are nil and false. This is a nice change over other languages where other things evaluate to false in boolean tests. Like C and many others, which considers the integer 0 to be false. So is 0.0 false? How about 1e-999999? Or […]

December 1st, 2007

Bang! (0)

Tags: ,

In Scheme, an exclamation point (aka “bang”) on the end of a procedure name indicates a procedure with side-effects e.g. a destructive procedure or mutator. This is only a naming convention for procedures and isn’t understood or enforced by the language.
In Ruby you can also have an exclamation point on the end of a […]