Posted by: leppie | September 3, 2007

Interesting article & source checkin tonite

Write Yourself a Scheme in 48 Hours: 11. Towards a Standard Library is a very interesting read. I found this by off chance in a Google search. I don’t really care for the Haskell part, but what did intrigue me, was the simplicity they described fold and unfold and how they apply it.

Off course the challenge was to actually test this code on IronLisp. At first I was rewriting alot to IronLisp dialect, this got tedious and error prone. I decided to use macro’s for what they intended for. Anyways 2 macro’s was sufficient for the bulk. And here they are:

(defmacro lambda (&rest body) 
  `(fn ,@body))
  
(defmacro define (nargs &rest body)
   `(defun ,(car ,nargs) ,(cdr ,nargs) ,@body)) 


As said, the aim was to test it, and beyond my expectations, it passed flying colors first time (except for a few syntax issues, like ‘new’ and clashing with existing functions).

I will be doing a checkin tonite. Some other things might still be broken, but you will get a nice dialog showing my acknowledgment of the issue :)

About these ads

Responses

  1. I am creating an entry on wikipedia about IronLisp. You can change it if it is incorrect.

  2. Thanks :)


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: