[coyotos-dev] Update to bitc spec

Jonathan S. Shapiro shap at eros-os.org
Fri Sep 1 16:11:02 CDT 2006


On Fri, 2006-09-01 at 22:53 +0200, Pierre THIERRY wrote:
> Scribit Jonathan S. Shapiro dies 30/08/2006 hora 17:21:
> > 2. Swaroop has written a document explaining in detail (and formally)
> > how the inference of mutability works. This was surprisingly tricky,
> > and the document covers a bunch of the pitfalls and issues. The
> > document has actually been on-line for some time, but it hasn't been
> > visible on the docs page until now.
> 
> I'm confused about the pair and list examples, in 1.2.1: the symbol for
> a value type union is used for the following union:
> 
> 	(defunion (list 'a) nil (cons car:'a cdr:(list 'a)))
> 
> whereas the symbol for a reference type union is used for the following:
> 
> 	(defunion (optional 'a):val  none (some it:'a))

I believe that you are reading this backwards.

First, the qualifier :val indicates a *value* type, not a reference
type. The qualifier :ref indicates a reference type, and in the absence
of any qualification :ref is assumed.

The formal type given for LIST is indicated as a reference type (Note *
under the circle-plus). The type given for OPTIONAL is a value type
(Note dot, or whatever the heck that is, under circle-plus).

> The first has no qualification and is said a value...

So far as I can see, the first has no qualification and is said to be a
reference (which is correct).

> , the second has a
> qualification of value and is sais a reference... 

In the copy of the document I am viewing, the second is said to be a
value.

Have I failed to see something?


shap



More information about the coyotos-dev mailing list