chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: type annotations


From: siiky
Subject: Re: type annotations
Date: Mon, 17 Aug 2020 16:04:16 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Thunderbird/80.0

On 8/16/20 1:54 PM, Claude Marinier wrote:
Allô,

I have discovered types.

https://wiki.call-cc.org/man/5/Types <https://wiki.call-cc.org/man/5/Types>

When used judiciously and sparingly, this could be useful to prevent errors and provide optimisation (specialisation) hints to the compiler.

Is there a guide to using this well? I would like examples. Perhaps one of the Chicken libraries or eggs can be used as an example.

Merci.

--
Claude Marinier

Hello,

I myself would like some good usage examples of `chicken.type`, but if you're just getting started and not sure how to use them, or you're getting errors, I hope [0, 1, 2] may be helpful to you. The annotations on the macros in [1, 2] are not as strict as they could be. And some of the other type annotations may even be wrong (e.g. using the symbol uri to mean an URI object; the way I use it, it's the same as using *, the "any" type), because usually the compiler doesn't complain too much and I forget to update them.

[0]: https://github.com/SiIky/ssg/blob/81e863733fa6b3e34608adc1ca89065f0759c836/ssg.converters.lowdown.scm#L32-L42 [1]: https://github.com/SiIky/invidious.scm/blob/09c1b26080ecf1ba64a86b3ece501d975ea3608a/invidious.req.v1.scm#L41-L58 [2]: https://github.com/SiIky/invidious.scm/blob/09c1b26080ecf1ba64a86b3ece501d975ea3608a/invidious.uri.v1.scm

André Sá




reply via email to

[Prev in Thread] Current Thread [Next in Thread]