[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

'or' and multiple values

From: Neil Jerram
Subject: 'or' and multiple values
Date: Wed, 26 Mar 2014 01:36:06 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)

Hi there!

In the following, is the last result a bug?

  GNU Guile 2.0.9-deb+1-1
  Copyright (C) 1995-2013 Free Software Foundation, Inc.

  Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
  This program is free software, and you are welcome to redistribute it
  under certain conditions; type `,show c' for details.

  Enter `,help' for help.
  scheme@(guile-user)> (values 'a 'b)
  $1 = a
  $2 = b
  scheme@(guile-user)> (or (values 'a 'b))
  $3 = a
  $4 = b
  scheme@(guile-user)> (or #f (values 'a 'b))
  $5 = a
  $6 = b
  scheme@(guile-user)> (or (values 'a 'b) (values 'c 'd))
  $7 = a

In other words it seems 'or' doesn't propagate multiple values in a
non-tail position.  Is that expected?

The manual section 'Returning and Accepting Multiple Values' does
mention tail position, but only in passing, and it isn't obvious to me
why that restriction should exist.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]