Subject: Re: values (STk vs. SCSH)
From: rpw3@rigden.engr.sgi.com (Rob Warnock)
Date: 1998/05/17
Newsgroups: comp.lang.scheme
Message-ID: <6jntja$1lmfg@fido.engr.sgi.com>

Michael N. Livshin <mike@nospam.olan.com> wrote [edited for brevity]:
+---------------
| Which of the two is correct?
| 1) STk way:  (call/cc (lambda (exit) (exit (values 1 2))))
| 2) SCSH way: (call/cc (lambda (exit) (exit 1 2)))
| BTW, SCSH's `values' also checks its arguments for not being multiple-valued.
+---------------

MzScheme agrees with "scsh", and throws an error on the "STk" version:

	> (call/cc (lambda (exit) (exit 1 2)))
	1
	2
	> (call/cc (lambda (exit) (exit (values 1 2))))
	context expected 1 value, received 2 values: 1 2
	> 

For what it's worth, MzScheme's documentation is at least explicit about it:

	[section on call/cc]
	"Multiple return values can be passed to a continuation"

	[section on multiple values]
	"An expression used in a procedure application (either as the
	procedure to be applied or one of the arguments) must always
	return a single value."
	...
	"When the number of values returned by an expression does not
	match the number of values expected by the expression's context,
	the EXN:APPLICATION:ARITY exception is raised (at run-time)."


-Rob

-----
Rob Warnock, 7L-551		rpw3@sgi.com   http://reality.sgi.com/rpw3/
Silicon Graphics, Inc.		Phone: 650-933-1673 [New area code!]
2011 N. Shoreline Blvd.		FAX: 650-933-4392
Mountain View, CA  94043	PP-ASEL-IA