[PRL] How about Tues 200-300 for macro reading group?

Matthias Felleisen matthias at ccs.neu.edu
Tue Sep 14 12:12:43 EDT 2004


Interesting idea. I will pose this question to my "312" students next 
semester. -- Matthias


On Sep 14, 2004, at 11:56 AM, John Clements wrote:

>
> On Sep 13, 2004, at 7:07 PM, Doug Orleans wrote:
>
>> Matthias Felleisen wrote:
>>> I got pretty sick staring at Perl, so I rewrote the program in Pretty
>>> Big. It's 2 lines longer, argh. Anyone who knows more about our
>>> libraries? -- Matthias
>>
>> Here's a line-by-line translation of Jeff's perl script into MzScheme.
>> It's as faithful as I could make it.  (I even learned something about
>> R5RS: the body of a "do" construct is not a <body> but a sequence of
>> <command>s, i.e. you can't start with a "define".  Hence I had to use
>> "let".  I was tempted to write a "for" macro instead.)  (I also
>> learned something about Perl: "$#foo" doesn't mean "the length of
>> foo", it means "the index of the last element in foo".  Weird.)
>
> ... nice short scheme program cut ...
>
> For the record, here's the code that I wrote last year, including 
> contracts, test cases, and a richer input language including both 
> "bad" and "impossible" times for each person.  Since every contiguous 
> block of time has two coordinates associated with it (# of bad, # of 
> impossible), it eliminates those which are unambiguously worse than 
> others and returns all the rest.  That is, it returns all minima for 
> the ordering where (i,j) <= (l,m) when (i <= l AND j <=m).
>
> ON THE OTHER HAND, the code is much much longer, and fails to use the 
> nice "bin sort" idea of seeing a day as a collection of small bins, 
> rather than as a continuous line. Not only is Jeff/Doug's code much 
> much shorter, the output is more easily read.
>
> So: Doug has demonstrated that you can write perl-ish code in Scheme.  
> Why don't we do it?  Which one would you rather maintain?
>
> john
>
> two files appended:
>
> <scheduling.ss>
> <schedule-consensus.ss>_______________________________________________
> PRL mailing list
> PRL at lists.ccs.neu.edu
> https://lists.ccs.neu.edu/bin/listinfo/prl




More information about the PRL mailing list