racket/collects/scheme
Eli Barzilay 505034ea26 The generator function can now be used to send values to the generator.
For example,

  (define g (generator (yield (yield (yield 1)))))
  (list (g) (g 2) (g 3) (g 4) (g) (g))

evaluates to '(1 2 3 4 4 4).  This is something that Python does (as a
generator.send method), which might be useful for using generators as
co-routines, and it is actually easy to implement since sending values
is exactly what we get when the generator call is actually calling the
saved continuation.  So most of the change is dealing with the
technicalities of throwing an error when the generator is called with
some arguments, when that's done after it's terminated (at the stage
where it's repeating the last value for ever).

A few tests added for this.

svn: r17979
2010-02-05 03:22:01 +00:00
..
base/lang Switch language readers to #lang s-exp 2009-06-16 17:13:51 +00:00
contract A bunch of additional typos 2010-02-05 03:21:52 +00:00
exists newlines at EOFs 2009-11-09 03:49:50 +00:00
gui Switch language readers to #lang s-exp 2009-06-16 17:13:51 +00:00
lang Switch language readers to #lang s-exp 2009-06-16 17:13:51 +00:00
load/lang Switch language readers to #lang s-exp 2009-06-16 17:13:51 +00:00
match A bunch of additional typos 2010-02-05 03:21:52 +00:00
private A bunch of additional typos 2010-02-05 03:21:52 +00:00
signature Allow for contracts without having to require scheme/contract in the 2009-12-04 21:07:13 +00:00
unit Switch language readers to #lang s-exp 2009-06-16 17:13:51 +00:00
unsafe fill out fl and fx operations; repair fixnum-overflow bug in quotient 2010-01-07 03:30:33 +00:00
async-channel.ss
base.ss
bool.ss
class.ss Change from (module ...) -> #lang and also move any mzscheme -> scheme/base. 2009-11-05 17:18:54 +00:00
cmdline.ss misc improvements to the code 2009-11-16 22:39:18 +00:00
contract.ss Refactoring all the private contract stuff into its own playpen. 2009-09-17 20:55:37 +00:00
control.ss
date.ss
dict.ss fix make-custom-weak-hash (PR 10232) 2009-05-09 13:37:28 +00:00
enter.ss
fasl.ss
file.ss Eli says it is a bad hack. 2009-11-23 18:04:15 +00:00
fixnum.ss fill out fl and fx operations; repair fixnum-overflow bug in quotient 2010-01-07 03:30:33 +00:00
flonum.ss fill out fl and fx operations; repair fixnum-overflow bug in quotient 2010-01-07 03:30:33 +00:00
foreign.ss added keywords: to the custom _fun thing 2009-12-21 08:52:44 +00:00
function.ss
future.ss scheme/future, sequential futures implementation when --enable-futures not specified; doc updates 2009-11-23 18:12:23 +00:00
generator.ss The generator function can now be used to send values to the generator. 2010-02-05 03:22:01 +00:00
gui.ss
help.ss
include.ss
init.ss
list.ss clarify optimization choice 2009-11-06 22:34:26 +00:00
load.ss
local.ss
main.ss tabs and indentation 2009-11-03 04:39:13 +00:00
match.ss Add disappeared-use properties for struct ids. 2009-10-01 18:59:12 +00:00
math.ss check arguments of scheme/math functions (PR 10197) 2010-01-08 13:50:21 +00:00
mpair.ss
mzscheme.ss promise code moved to scheme/private 2009-12-05 09:07:17 +00:00
nest.ss
package.ss another syntax hack to fix 'scheme/package'; other test corrections 2009-11-27 02:12:27 +00:00
path.ss
place.ss
port.ss switch to #lang 2009-10-30 08:01:43 +00:00
pretty.ss move pretty-print implementation from mzlib to scheme 2009-09-13 13:56:22 +00:00
promise.ss moved extra promise types back to scheme/promise 2009-12-05 09:28:41 +00:00
provide-syntax.ss
provide-transform.ss
provide.ss replaced at-syntax with syntax-local-eval 2009-12-02 23:39:55 +00:00
require-syntax.ss
require-transform.ss
require.ss replaced at-syntax with syntax-local-eval 2009-12-02 23:39:55 +00:00
runtime-path.ss
sandbox.ss only for programs 2010-01-26 15:04:51 +00:00
serialize.ss
shared.ss
splicing.ss fix problem with expansion to lambda in class form; better certficate transparency in splicing-let forms 2009-12-30 12:35:21 +00:00
string.ss
struct-info.ss
stxparam-exptime.ss
stxparam.ss allow empty splicing-syntax-parameterize body in a defn context (PR 10311) 2009-06-24 13:17:17 +00:00
surrogate.ss
system.ss
tcp.ss Allow binding to ephemeral ports 2009-10-20 17:00:20 +00:00
trace.ss export mzlib/trace from the scheme collection 2009-09-22 04:39:20 +00:00
trait.ss
udp.ss Allow binding to ephemeral ports 2009-10-20 17:00:20 +00:00
unit-exptime.ss
unit.ss
vector.ss fix error messages 2009-11-21 00:16:08 +00:00