P. 1
pure

pure

|Views: 19|Likes:
Published by Yezi Huang

More info:

Published by: Yezi Huang on Jan 27, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

11/13/2011

pdf

text

original

[4.4 Types and Type functions (18)] susp does not admit equality.

Remark: This is an arbitrary choice. Allowing an equality operator on suspensions that
automatically forces the suspensions and compares the results would also be reasonable, but
would be moderately complicated.

3

[4.7 Non-expansiveExpressions (20)] $ expressions are non-expansive.

Remark: The dynamicevaluation ofa $expressionmayinfactextendthedomainofmemory,
but, for typechecking purposes, suspensions should be more like functions than references.3

[4.10 Inference Rules (24,29)] Add the following inference rules.

C

`

exp)

C

`

$ exp)

susp and

C

`

pat)

C

`

$ pat)

susp

[4.11 Further Restrictions (30)] Because matching against a $ pattern may have effects (in
particular, may cause assignments), it is now more difficult to determine if matches involving
both suspensions and referencesareirredundant and exhaustive. Forexample, thefirstfunction
below is non-exhaustive even though the first and third clauses appear to cover all cases and
the second is irredundant even though the first and fourth clauses appear to overlap.

fun f (ref true, ) = 0

fun f (ref true, ) = 0

j

f (ref false, $0) = 1

j

f (ref false, $0) = 1

j

f (ref false, ) = 2

j

f (ref false, ) = 2

j

f (ref true, ) = 3

(Considertheexecutionoff (r,$(r := true; 1))whererinitiallyequalsreffalse.)

[Appendix C: The Initial Static Basis (74,75)] ExtendT

0

to includesusp, which has arity

1 and does not admit equality.

Add force to VE0

(Figure 23), where

force7!

8

’a:

’a susp!

’a

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->