Updated: 11/5/2005; 6:05:29 PM.
Chris Double's Radio Weblog
        

Tuesday, March 02, 2004

Meme is an IRC channel browser written in Common Lisp by Kevin Rosenberg. It logs various channels from freenode and allows viewing, searching and graphing details about those channels.

3:53:03 PM      

From Lambda the Ultimate comes a pointer to some arcticles on implementing a 'range' macro in Scheme, and how this allows you to write code in Scheme that is very similar to Python's 'for' construct.

The 'range' macro allows you to create a range of numbers and perform actions on that range. It is efficient in that it doesn't construct a termporary list to create the range. Code that uses the range does not need to be written to have knowledge of it. For example, take the factorial function:
	(define (fact n) (if (<= n 0) 1 (* n (fact (- n 1)))))
The following code will display the factorials of numbers 1 through to 5 using range:
	(breset r (begin (display (fact (range r 1 5))) (newline)))
Nesting, breaking, continuing, etc is all supported. For more about 'range' see Oleg's Usenet posting. For further examples and how it can be used to emulate Python's 'for' operator, Oleg has another posting exanding on it.

1:30:39 PM      

© Copyright 2005 Chris Double.
 
March 2004
Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Feb   Apr



Click here to visit the Radio UserLand website.

Listed on BlogShares

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.