Ted Leung on the air
Ted Leung on the air: Open Source, Java, Python, and ...
Sat, 10 May 2003
Testing and dynamic typing
I was going tg write a post about testing and dynamic typing, but Patrick Logan and Jarno Virtanen beat me to it.
[00:16] | [computers/programming] | # | TB | F | G | 0 Comments | Other blogs commenting on this post
macros vs keyword messages
It's great when you actually learn something new, and I seem to do that quite frequently in the weblog world. Here's today's:

Patrick Logan, who I remember from comp.lang.dylan days, had this to say about syntax extension:

While Smalltalk doesn't have syntax macros like Lisp, Smalltalk *does* have simpler block syntax and keyword arguments.

The effect is that new keyword messages can take block closures, which essentially delay evaluation until the method behind the message decides to evaluate them, and the message send looks an awful lot like new syntax, very clean.

Many uses of macros in Lisp, frankly, are simply created to hide the appearance of the lambda keyword. Of course there are more "legitimate" uses of macros, but these are less common.

This use of keyword messages and closures is really interesting. In Chapter 8 of On Lisp, Graham lists 6 reasons to use macros. Delaying or altering evaluation is an aspect of the first 4 reasons. Reason 5 involves using the calling environment, which you very rarely want to do, reason 6 involves using a new lexical environment, which you also rarely want to do, and reason 7 is inlining which is a performance annotation.

I'd be curious to see some examples of this type of Smalltalk code.

[00:12] | [computers/programming/lisp] | # | TB | F | G | 3 Comments | Other blogs commenting on this post

twl JPG


Ted Leung FOAF Explorer

I work at the Open Source Applications Foundation (OSAF).
The opinions expressed here are entirely my own, not those of my employer.

Creative Commons License
This work is licensed under a Creative Commons License.

Now available!
Professional XML Development with Apache Tools : Xerces, Xalan, FOP, Cocoon, Axis, Xindice
Technorati Profile
PGP Key Fingerprint
My del.icio.us Bookmarks
My Flickr Photos

RSS 2.0 xml GIF
Comments (RSS 2.0) xml GIF
Atom 0.3 feed
Feedburner'ed RSS feed

< May 2003 >
     1 2 3
4 5 6 7 8 910


Macintosh Tips and Tricks

Blogs nearby
geourl PNG

/ (1567)
  books/ (33)
  computers/ (62)
    hardware/ (15)
    internet/ (58)
      mail/ (11)
      microcontent/ (58)
      weblogs/ (174)
        pyblosxom/ (36)
      www/ (25)
    open_source/ (145)
      asf/ (53)
      osaf/ (32)
        chandler/ (35)
        cosmo/ (1)
    operating_systems/ (16)
      linux/ (9)
        debian/ (15)
        ubuntu/ (2)
      macosx/ (101)
        tips/ (25)
      windows_xp/ (4)
    programming/ (156)
      clr/ (1)
      dotnet/ (13)
      java/ (71)
        eclipse/ (22)
      lisp/ (34)
      python/ (86)
      smalltalk/ (4)
      xml/ (18)
    research/ (1)
    security/ (4)
    wireless/ (1)
  culture/ (10)
    film/ (8)
    music/ (6)
  education/ (13)
  family/ (17)
  gadgets/ (24)
  misc/ (47)
  people/ (18)
  photography/ (25)
    pictures/ (12)
  places/ (3)
    us/ (0)
      wa/ (2)
        bainbridge_island/ (17)
        seattle/ (13)
  skating/ (6)
  society/ (20)

[Valid RSS]

del.icio.us linkblog



Listed on BlogShares

Locations of visitors to this page
Where are visitors to this page?

pyblosxom GIF