Subject: Re: Is DSSSL Syntax Tricky? From: lee@xxxxxx Date: Tue, 20 May 97 22:36:25 EDT |
Paul Prescod waxed lyrical about map... And I recall that I used to have a shell programming guide for Unix System 4.1 (never released -- nothing to do with BSD 4.1) that used "map" as a simple example shell script. Anyone who wants some examples of map and other Scheme functions and techiques should go and buy two awfully thin books from the MIT press, the Little Schemer and the Seasoned Schemer. Or come on one of our Sculptor/Scheme courses and get given a copy :-) :-) It's much easier to learn Scheme with some good clear examples. Also use an editor that balances parentheses... e.g. emacs, or vi in lisp more (:set lisp) (not implemented in most of the free versions of vi) as otherwise you're making life much too difficult! > Any time you need to do something to all elements of a list, node-list > or string, you can convert it to a list, write a little function that > does the "thing", use the function as the first argument and the list > as the second, map will return a list. It's also common in Scheme to use an anonymous function there, with lambda: (map (lambda (x) (+ x 3)) (list 1 2 3 4)) => '(3 5 6 7) DSSSL has lambda expressions (8.3.1.4) although I don't know if the syntax is there in Jade (and can't try from here, sorry!). It is easy to write very short fragments of scheme that are very hard to understand using this paradigm. Use plenty of comments! Use long, long identifiers. It's excellent that the DSSSL standard is so clearly written and follows this model. Lee -- Liam Quin, lee@xxxxxx | lq-text freely available Unix text retrieval Senior Technical Consultant | FAQs: Metafont fonts, OPEN LOOK UI, OpenWindows SoftQuad Inc. +1 416 544-9000 | xfonttool (Unix xfontsel in XView) http://www.softquad.com/ | the barefoot programmer DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: Is DSSSL Syntax Tricky?, Paul Prescod | Thread | Re: Is DSSSL Syntax Tricky?, James Clark |
Overlapping, polygonal FOs, Ingo Macherius | Date | Re: Overlapping, polygonal FOs, James Clark |
Month |