Home > Archive > Scheme > February 2007 > Where is Olin Shivers loop macro?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Where is Olin Shivers loop macro?
|
|
| joe nada 2007-02-25, 4:11 am |
| Hi *
I just saw this video of great stuff:
http://video.google.com/videoplay?d...771882785&hl=en
Olin Shiver's presentation about The Anatomy of Loop. I'm sure many of
you have heard of it.
I can't seem to find where exaclty is the code for this? Did any of his
ideas make into a SRFI or a standard? Is it implementation-specific?
TIA,
JN
| |
| Emilio Lopes 2007-02-25, 8:05 am |
| joe nada writes:
> I just saw this video of great stuff:
> http://video.google.com/videoplay?d...771882785&hl=en
> Olin Shiver's presentation about The Anatomy of Loop. I'm sure many of
> you have heard of it.
> I can't seem to find where exaclty is the code for this? Did any of his
> ideas make into a SRFI or a standard? Is it implementation-specific?
IIRC, in his paper "The Anatomy of a Loop" he mentions that there
exists no implementation of his loop macro.
Alex Shinn did an excellent analysis of loops in Scheme, including
Shivers' macro:
http://groups.google.com/group/comp...60dcac5ea812398
--
Emílio C. Lopes
Munich, Germany
| |
| Jens Axel Søgaard 2007-02-25, 8:05 am |
| Emilio Lopes skrev:
> joe nada writes:
>
>
>
>
>
> IIRC, in his paper "The Anatomy of a Loop" he mentions that there
> exists no implementation of his loop macro.
He has a section that talks about the number of lines.
Try asking the Scheme48 list, since Olin uses Scheme48.
Or mail Olin directly.
--
Jens Axel Søgaard
| |
| Ray Blaak 2007-02-25, 10:08 pm |
| joe nada <joe@nada.com> writes:
> I just saw this video of great stuff:
>
> http://video.google.com/videoplay?d...771882785&hl=en
>
> Olin Shiver's presentation about The Anatomy of Loop. I'm sure many of
> you have heard of it.
I just don't get the excellence of it.
I have been programming seriously since 1984, and I have never ever needed
complex loops like this.
The overwhelming number of cases are simple simgle-path for loops over
specific sequences, and any thing more complicated were simple recursive
calls that I actually find clearer than all of this CFG lego loop blocks,
intermediate states, and what have you.
Am I missing something?
--
Cheers, The Rhythm is around me,
The Rhythm has control.
Ray Blaak The Rhythm is inside me,
rAYblaaK@STRIPCAPStelus.net The Rhythm has my soul.
| |
| Kjetil Svalastog Matheussen 2007-02-25, 10:08 pm |
| On Sun, 25 Feb 2007, Emilio Lopes wrote:
> joe nada writes:
>
>
>
>
>
> IIRC, in his paper "The Anatomy of a Loop" he mentions that there
> exists no implementation of his loop macro.
>
But he did mention at the end of the speach that it was implemented using
low-level macros in scheme48...
As an alternative, here's a common lisp loop macro implementation for
scheme: http://commonmusic.sourceforge.net/doc/cm.html
(Look at the file src/loop.scm, it only requires define-macro, error and
gensym to be portable for all schemes.)
| |
| Joel Wilsson 2007-02-26, 4:16 am |
| On Feb 26, 3:05 am, Ray Blaak <rAYbl...@STRIPCAPStelus.net> wrote:
> The overwhelming number of cases are simple simgle-path for loops over
> specific sequences, and any thing more complicated were simple recursive
> calls that I actually find clearer than all of this CFG lego loop blocks,
> intermediate states, and what have you.
>
> Am I missing something?
http://www-static.cc.gatech.edu/~sh...papers/loop.pdf
The first section is all about why you would want a loop macro.
It has a code listing of a decent if somewhat contrived example.
Personally I don't care much for the syntax in that one, and I read
some criticism somewhere else about how it was unnatural to not be
able to nest loops normally (instead you have to use "subloop" if you
want a loop inside a loop, a limitation few other loop macros share).
I think it was in the documentation for another loop macro, but I
can't remember which one... Olin's loop macro is one of many and it
seems to me it was done sort of as an excuse to go crazy with CFGs.
Nothing wrong with that, but it's not obvious how it's better than
the alternatives. Certainly the definition of the Common Lisp loop
is vague and leaves a lot up to the implementations, but this is not
something that is bothering CL programmers - it just works the way
you'd expect, and I think you'd have to be doing some really weird
stuff to get bitten by the scoping rules (or the lack of them).
One problem with loop macros is that it's easy to get so used to them
that you forget about reduce, map, etc. and just write a tiny loop
instead, which isn't nearly as elegant or succinct. I've seen that in
some CL screencasts and I've found myself guilty of this a few times.
Anyways, loop macros can be useful but are of course not necessary.
It's syntactic sugar, but sugar is sweet. Just gotta keep the urge
for it under control and use it moderately where appropriate. :)
Regards,
Joel
| |
| Ray Blaak 2007-02-26, 4:16 am |
| "Joel Wilsson" <joel.wilsson@gmail.com> writes:
> On Feb 26, 3:05 am, Ray Blaak <rAYbl...@STRIPCAPStelus.net> wrote:
>
> http://www-static.cc.gatech.edu/~sh...papers/loop.pdf
>
> The first section is all about why you would want a loop macro.
> It has a code listing of a decent if somewhat contrived example.
Thanks. The paper presents the situation more clearly.
Still, I don't really notice the problem much. Perhaps I tend to simplify my
loops in other ways, e.g. a more high-order functional style can often help
ignore the iteration details of a loop, and allow easy maintenance in the face
of representation changes (e.g. from list to vector).
--
Cheers, The Rhythm is around me,
The Rhythm has control.
Ray Blaak The Rhythm is inside me,
rAYblaaK@STRIPCAPStelus.net The Rhythm has my soul.
| |
| Jan Skibinski 2007-02-27, 7:13 pm |
| Ray Blaak wrote:
> Still, I don't really notice the problem much. Perhaps I tend to simplify=
my
> loops in other ways, e.g. a more high-order functional style can often he=
lp
> ignore the iteration details of a loop, and allow easy maintenance in the=
face
> of representation changes (e.g. from list to vector).
I concur. I also feel that the first example in that paper has been
overblown to some extent to show advantages of the macro-based
approach.
Don't get me wrong - I like using macros, but this remainds me the two
different approaches to the vector/tensor notation.
One usually starts in high school with a standard vector notation with
arrows, crosses and dots; then one graduates to the algebraic notation
with Einstein summation convention, the Kronecker delta and the
permutation symbol (Levi-Civita pseudo-tensor); only to go back to
index-less abstract operations on tensors -- with such concepts as
tensor contraction, etc.
The last form is good for writing papers since it is very concise and
free of indices; the loops are hidden and only implied by some
symbols, such as =E2=8A=97 -- suggesting some contractions in some indices.
But I suspect that most people revert back to explicit index-based
notation whenever they actually need to compute with complex tensorial
formulae.
See, for example: http://mathworld.wolfram.com/Tensor.html
Jan
|
|
|
|
|