Oh. I neglected to say something important here.

In an effect type system, expressions and function types carry effects,
but values do not. Every expression has an effect variable resolution,
and in principle that effect should be displayed. Thus, when we evaluate

  (+ 1 2:int32)

we should get something like:

  2:int32 pure

with the intended meaning that the result is two and that the
computation had no side effects. [Note that this result is only obtained
if shap designs your computer. Conventional machines implement
arithmetic correctly, and even most Intel machines implement floating
point arithmetic correctly. :-)]

But most of the time we are completely uninterested in whether the
expression evaluation is pure or not, so I think that the interactive
system generally should not bother to print the effect. When the user
cares, the input expression can be re-written as:

 (pure (+ 1 2:int32))

with the result that you will get one of:

  3:int32         OR
  <input>:7 expression with prohibited effect

I can certainly see a use for debugging modes that would make the
effects explicit, but for normal use we should keep the effects as
unobtrusive as possible.


shap

_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to