This site is a static rendering of the Trac instance that was used by R7RS-WG1 for its work on R7RS-small (PDF), which was ratified in 2013. For more information, see Home.

Source for ticket #399

cc


    

changetime

2012-10-07 11:30:53

component

WG1 - Core

description

The standard allows the following extension to force:

  Some implementations may implement "implicit forcing," where the
  value of a promise is forced by primitive procedures like `cdr'
  and `+'

We should remove this note or tighten the definition.

id

399

keywords


    

milestone


    

owner

cowan

priority

major

reporter

alexshinn

resolution

fixed

severity


    

status

closed

summary

clarify which primitives are allowed to implicitly force

time

2012-06-10 10:59:39

type

defect

Changes

Change at time 2012-10-07 11:30:53

author

cowan

field

comment

newvalue


    

oldvalue

4

raw-time

1349584253717048

ticket

399

time

2012-10-07 11:30:53

Change at time 2012-10-07 11:30:53

author

cowan

field

resolution

newvalue

fixed

oldvalue


    

raw-time

1349584253717048

ticket

399

time

2012-10-07 11:30:53

Change at time 2012-10-07 11:30:53

author

cowan

field

status

newvalue

closed

oldvalue

writing

raw-time

1349584253717048

ticket

399

time

2012-10-07 11:30:53

Change at time 2012-08-27 08:26:26

author

cowan

field

comment

newvalue


    

oldvalue

3

raw-time

1346030786570513

ticket

399

time

2012-08-27 08:26:26

Change at time 2012-08-27 08:26:26

author

cowan

field

owner

newvalue

cowan

oldvalue

alexshinn

raw-time

1346030786570513

ticket

399

time

2012-08-27 08:26:26

Change at time 2012-08-27 08:26:26

author

cowan

field

status

newvalue

writing

oldvalue

decided

raw-time

1346030786570513

ticket

399

time

2012-08-27 08:26:26

Change at time 2012-08-26 23:20:02

author

cowan

field

comment

newvalue

WG1 voted to adopt the rule that a procedure which performs a type-check on its arguments is permitted to implicitly force promises.

oldvalue

2

raw-time

1345998002143864

ticket

399

time

2012-08-26 23:20:02

Change at time 2012-08-26 23:20:02

author

cowan

field

status

newvalue

decided

oldvalue

new

raw-time

1345998002143864

ticket

399

time

2012-08-26 23:20:02

Change at time 2012-06-11 11:05:55

author

cowan

field

comment

newvalue

 1. Procedures whose arguments belong to specific types should be allowed to force promises to see if the value of the promise belongs to that type.  That covers `cdr` and `+` and the great majority of standard procedures.
 2. The type-identifying predicates `number? complex? real? rational? integer? boolean? pair? null? list? symbol? char? string? vector? bytevector? procedure? error-object? input-port? output-port? textual-port? binary-port? port? eof-object?` should likewise be allowed to force promises, given that promises are not a disjoint type and there is no way to identify one.  So `number?` should be allowed to return `#t` either on a number or a promise whose value is a number.
 3. The constructors `cons list vector`, the pseudo-constructor `values`, and the mutators `set-car! set-cdr! list-set! vector-set!` should ''not'' be allowed to force promises.  A promise is an object, and it should be possible to put it into a data structure without forcing it.  Likewise, the keyed accessors `memq memv member assq assv assoc` should be able to retrieve a promise from a list.
 4. I don't have a good intuition about the remaining procedures that accept arbitrary objects.  They seem to fall into these groups:
    a. `make-promise`: what happens if the argument is already a promise?  The draft doesn't say.
    b. the equivalence predicates `eq? eqv? equal?`: should promises be distinct from their values?
    c. `not`: can a promise whose value is `#f` count as false?
    d. the error procedures `raise raise-continuable error`: what's to be done?
    e. the output procedures `write write-simple display`: what's to be done?
    f. `exit`: what's to be done?
    g. `list-copy`: the argument is normally a list, but can be an arbitrary object (a degenerate case of an improper list) in which case it returns the object.

oldvalue

1

raw-time

1339387555200281

ticket

399

time

2012-06-11 11:05:55