Newsgroups: comp.lang.lisp, comp.lang.python, comp.lang.scheme, comp.lang.functional
From: Jock Cooper <jo...@mail.com>
Date: 06 Oct 2003 18:02:16 -0700
Local: Mon, Oct 6 2003 9:02 pm
Subject: Re: Python syntax in Lisp and Scheme
my-first-name.my-last-n...@jpl.nasa.gov (Erann Gat) writes: I'm afraid it's very hard to give any convincing examples of the > In article <eppstein-9700A3.10461306102...@news.service.uci.edu>, David > Eppstein <eppst...@ics.uci.edu> wrote: > > In article > > > > : Here's another example of what you can do with macros in Lisp: > > > > : (with-collector collect > > > > : This returns a list of all the lines in a file that have some property. > > > > OK, that's _definitely_ just a filter: filter someproperty somefilename > > > The net effect is a filter, but again, you need to stop thinking about the > > Answer 1: literal translation into Python. The closest analogue of > > def lines_with_some_property(some_file_name): > You left out the with-collector part. > But it's true that my examples are less convincing given the existence of > I'll try to come up with a more convincing short example if I find some utility of macros -- as long as you are sticking to trivial examples. On the other hand, you can't exactly post real world complex examples of how macros saved you time and LOC (we all have em) because reader's eyes would just glaze over. I think macros are just another one of CL's features that some most people just don't get until they actually use them. But here's a small one: I wrote about 60 lines worth of macro based code (including a few reader (with-dbconnection In the "some code" section, the result columns' values are accessed by Jock You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||