[clean-list] relationship between uniqueness types and single-threaded lambda calculus?

Edsko de Vries devriese at cs.tcd.ie
Wed May 30 17:59:43 MEST 2007


On Wed, May 30, 2007 at 05:47:21PM +0200, John van Groningen wrote:
> 
> Edsko de Vries wrote:
> >I had a quick read through the paper you mentioned. However, since that
> >was the first time I read about the STPLC, I find it hard to compare it
> >to uniqueness typing. I agree that one difference is that the example
> >they give in the paper:
> >
> >swap! a i j =
> >  let* x = lookup a i
> >       y = lookup a j
> >  in update! (update! a i y) j x
> >
> >cannot be typed in Clean. However, I'm not sure if this is due to the
> >lack of the "r" mode Instead, I would venture that this is due to the
> >absence of a "let*" construct in Clean.  I'm not sure why it isn't there
> >actually, and it would be relatively straightforward to add it (I might
> >just do that in the system I'm proposing :)
> 
> This looks like observation typing using #! (non recursive strict let).
> See section 9.4 of the Clean language report.
> 
> The swap function could be written as:
> 
> swap a i j
> 	#! x = lookup a i
> 	#! y = lookup a j
> 	= update! (update! a i y) j x

Ah. I stand corrected :) I had forgotten about #!.

Thanks

Edsko


More information about the clean-list mailing list