Hi Kiwamu,

чт, 1 нояб. 2018 г. в 10:00, Kiwamu Okabe <kiw...@debian.or.jp>:

> Dear Artyom and Hongwei,
> sorry for my late reply.
>
> On Mon, Oct 29, 2018 at 5:17 PM Artyom Shalkhakov
> <artyom.shalkha...@gmail.com> wrote:
> > While I'm not sure why your code fails, it's an interesting project
> you've started.
>
> Thanks. It's very fun and good exercise for me.
>
> > Actually, I have an idea about your code. You may have to an annotation
> like...
>
> Thanks for your advice. But it's not clear for me...
>
> > if :( line: strnptr(m) ) => .. then ... else ... onto your conditionals.
>
> Where line of my code should follow your advice?
>
>
> https://github.com/metasepi/uemacs-bohai/blob/9ecdd06fe09e6433ed0fb4271c0e5b44d2ad8f8d/DATS/utf8.dats
>
>
You should put at at every branch (so on every [if] and on every [case]).
That's because the variable [line] is of linear type, and the annotation
basically says that in every alternative of the branch it's going to be
preserved (so, after the evaluation of an [if] or a [case] the type of
[line] is going to still be [strnptr(m)]). I think the reason for having to
annotate it is due to a hit on performance in constraint solving. I think I
read about this in one of HX's papers.

I think in your case, you'll have to annotate two [if]s:

https://github.com/metasepi/uemacs-bohai/blob/9ecdd06fe09e6433ed0fb4271c0e5b44d2ad8f8d/DATS/utf8.dats#L48
https://github.com/metasepi/uemacs-bohai/blob/9ecdd06fe09e6433ed0fb4271c0e5b44d2ad8f8d/DATS/utf8.dats#L55

Could you try it? You could also try to annotate only one [if] to find a
minimal required annotation that keeps the typechecker silent. :-)

>
> Best regards,
> --
> Kiwamu Okabe at METASEPI DESIGN
>
> --
> You received this message because you are subscribed to the Google Groups
> "ats-lang-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ats-lang-users+unsubscr...@googlegroups.com.
> To post to this group, send email to ats-lang-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/ats-lang-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ats-lang-users/CAEvX6d%3Dsb8%3DkqyLc0j3bipb16_zp26FsdZ%3DfD5Q0g5k7f9ZM3g%40mail.gmail.com
> .
>


-- 
Cheers,
Artyom Shalkhakov

-- 
You received this message because you are subscribed to the Google Groups 
"ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ats-lang-users+unsubscr...@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/CAKO6%3Dqh5yYagiaTtB32BD5RV_3ZwwMkJ4_thZ_%2BR-McjR_FjTw%40mail.gmail.com.

Reply via email to