racket/pkgs/racket-doc/scribblings
Matthew Flatt d7b18e7a9c adjust map and for ... in-list to not retain their lists
Adjust list and stream handling as sequences so that during the body

 (for ([i (in-list l)])
   ....)

then `i` and its cons cell in `l` are not implicitly retained while
the body is evaluated. A `for .... in-stream` similarly avoids
retaining the stream whose head is being used in the loop body.

The `map`, `for-each`, `andmap`, and `ormap` functions are similarly
updated.

The `make-do-sequence` protocol allows an optional extra result so
that new sequence types could have the same properties. It's not clear
that using `make-do-sequence` is any more useful than creating the new
sequence as a stream, but it was easier to expose the new
functionality than to hide it.

Making this work required a repair to the optimizer, which would
incorrectly move an `if` expression in a way that could affect
space complexity, as well as a few repairs to the run-time system
(especially in the vicinity of the built-in `map`, which we should
just get rid of eventually, anyway).
2016-12-13 19:20:41 -07:00
..
foreign add more codes to lookup-errno, relax contract (#1433) 2016-09-12 18:07:44 -04:00
getting-started remove the "racket-pkgs" directory layer 2014-12-08 05:22:59 -07:00
guide Update docs to reflect xrepl being enable by default. 2016-11-08 08:58:21 -06:00
inside restore SCHEME_INPORT_VAL and SCHEME_OUTPORT_VAL 2016-08-13 14:15:54 -06:00
more update "More" now that xrepl is on by default 2016-10-15 07:28:43 -06:00
raco setup-plt -> raco setup 2016-08-24 15:33:07 -05:00
reference adjust map and for ... in-list to not retain their lists 2016-12-13 19:20:41 -07:00
scheme remove the "racket-pkgs" directory layer 2014-12-08 05:22:59 -07:00
style respond to Matthias's comments 2016-03-09 14:36:25 -06:00
finger.png remove the "racket-pkgs" directory layer 2014-12-08 05:22:59 -07:00
icons.css remove the "racket-pkgs" directory layer 2014-12-08 05:22:59 -07:00
icons.rkt remove the "racket-pkgs" directory layer 2014-12-08 05:22:59 -07:00
icons.tex remove the "racket-pkgs" directory layer 2014-12-08 05:22:59 -07:00
info.rkt remove the "racket-pkgs" directory layer 2014-12-08 05:22:59 -07:00
magnify.png remove the "racket-pkgs" directory layer 2014-12-08 05:22:59 -07:00