There is also <return: BlElement or: nil> to indicate explicitly that user
must check for nil. There are only a few methods in element (#owner and
some collection related methods like "find element such that") that may
return nil.

Ideally syntax checker should take into account that method can return nil
and indicate it somehow to user.

Annotating return values is very common nowadays in popular dynamically
typed languages to help static analysis of IDE.

Annotating return values allows to instantly browse its class.

Small script can remove those annotations and asserts from code during
build for production on CI server.

I don't understand why only symbols are allowed. In any console string
parameter without spaces can be used directly without quotes. So for
pragmas should work (and it works in latest pharo)
<return: Point>
<return: nil>
<return: #Point>
<return: 'Point'>
<return: #'Point of view'>
<return: 'Point of view'>

I had the following pragma:
<return: MyMagicClass> After renaming of MyMagicClass in nautilus it was
also renamed in pragma.


On Tue, Feb 23, 2016 at 12:47 AM, stepharo <[email protected]> wrote:

> Hi
>
> I saw that something <return: #Point> or <return: Point>
> I do not know why but I have the impression that <return: #Point> is
> better.
> Because we may have code not present and still want to load the code.
>

Given the current semantics of pragmas only <return: #Point> is valid.

_,,,^..^,,,_
best, Eliot

Reply via email to