scp@raven.lanl.gov (Stephen Pope) (05/10/89)
Thanks to folks here in netland, I recently got a copy of SCOOPS (for those still wondering where it can be found, try ftp to linc.cis.upenn.edu (130.91.6.8). sherin@linc.cis.upenn.edu seems to be the responsible party, though don't take this as *my* endorsement to hound him with mail. In any case, I found two problems in bringing scoops up under MIT-CSCHEME: Release 6.1.2 Microcode 10.2 Runtime 13.91 SF 3.13 First, the replacements of "syntax-table-define ..." with "add-syntax!" et. al were unnecessary - I didn't touch my existing runtime band. Second, SCOOPS made use of the REC special form. This was apparently removed from the language as of R3RS. In any case, I got runtime errors (Unbound variable NAME). It is always used in the form: ((rec name (lambda ...)) args ...) where name needs to recursively call itself. I'm no SCHEME wizard, but it seemed the proper equivalent was: (let ((name (lambda ...))) (name args ...)) which appears to run just fine. Can anybody enlighten me on the subject of REC and its demise? Stephen Pope Santa Fe Institute scp@sfi.santafe.edu
dorai@titan.rice.edu (Dorai Sitaram) (05/11/89)
In article <SCP.89May10103519@raven.lanl.gov> scp@raven.lanl.gov (Stephen Pope) writes: >Second, SCOOPS made use of the REC special form. This was apparently >removed from the language as of R3RS. In any case, I got runtime >errors (Unbound variable NAME). It is always used in the form: > > ((rec name (lambda ...)) args ...) > >where name needs to recursively call itself. I'm no SCHEME wizard, >but it seemed the proper equivalent was: > > (let ((name (lambda ...))) (name args ...)) > >which appears to run just fine. > >Can anybody enlighten me on the subject of REC and its demise? Your equivalent should have a LETREC rather than a LET. Any REC-expression (not just in the application-context you mention and not just for LAMBDA-forms either) can be stated with a LETREC (which in its term is based on LAMBDA and SET!) as follows: (rec name exp) == (letrec ([name exp]) name) A possible reason for not mentioning REC as "essential syntax" in R3RS could be that the corresponding LETREC-equivalent is quite as readable. LETREC, of course, has more claim to the status of "essential syntax" since, in contrast to REC, it can also introduce several mutually recursive bindings. It is probably stretching it a bit to think of REC's omission from R3RS in such tragic terms as "demise". Any basic macro facility can resurrect it for you. --dorai ------------------------------------------------------------------------------ It may be that the gulfs will wash us down; It may be we shall touch the Happy Isles. ------------------------------------------------------------------------------
dorai@titan.rice.edu (Dorai Sitaram) (05/11/89)
In article <3246@kalliope.rice.edu> I write: >Any REC-expression (not just in the application-context you mention >and not just for LAMBDA-forms either) can be stated with a LETREC >(which in its term is based on LAMBDA and SET!) as follows: ^^^^ It could be well-nigh impossible to figure out that the above is a typo for "turn". Hence this posting. (For what it's worth, I was thinking of term-rewriting something, and psychology did the rest.) ------------------------------------------------------------------------------ It may be that the gulfs will wash us down; It may be we shall touch the Happy Isles. ------------------------------------------------------------------------------