[Pharo-users] IS there TypePlug for Pharo or similar type annotation tool?

Marcus Denker marcus.denker at inria.fr
Sat Oct 3 03:54:05 EDT 2015


> On 02 Oct 2015, at 20:50, Peter Uhnák <i.uhnak at gmail.com> wrote:
> 
> Hi,
> 
> What options do we have in terms of type annotations in Pharo?
> 
> I stumbled upon TypePlug this https://marcusdenker.de/talks/08ParisTypes/08ParisTypePlug.pdf <https://marcusdenker.de/talks/08ParisTypes/08ParisTypePlug.pdf> (or rather this http://scg.unibe.ch/archive/masters/Hald07a.pdf <http://scg.unibe.ch/archive/masters/Hald07a.pdf> )
> 
> which enabled type annotation for Squeak such as
> ~~~~~~~~~~~~~~~~
> Fruit>>mixWith: aFruit <:type: Fruit :>
>     ^ (Array with: self with: aFruit) <:type: Array E: Fruit :>
> ~~~~~~~~~~~~~~~~
> Orange>>color
>     ^ (Color orange) <:type: Color :>
> ~~~~~~~~~~~~~~~~
> (or even blocks)
> [ :a1 <:type: Integer :> :a2 <:type: Integer :> | a1 + a2 ]
> ~~~~~~~~~~~~~~~~
> 
> obviously something like this wouldn't even compile in Pharo (does Sqeak have different syntax for pragmas, or did the TypePlug change the syntax?)
> 

This was based on a hacked compiler (using a smack grammar on top of a code generator based on RB Nodes similar to the one we have now in
Opal). We changed the grammar to parse these kind of annotations.

	Marcus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/attachments/20151003/eb2d64fc/attachment.html>


More information about the Pharo-users mailing list