I do not understand this question.

Why can't you define vtfunc_t as follows:

typedef
vtfunc_t = (!chss(chss_isr) | ptr) -> void 

On Saturday, June 18, 2016 at 6:48:48 AM UTC-4, Kiwamu Okabe wrote:
>
> Hi Hongwei, 
>
> I have the other question. Following code has `chVTSetI` function: 
>
>
> https://github.com/fpiot/chibios-ats-2/blob/720847a31b9417ee267a34bf1746802e916ce03b/demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB/main.dats#L84
>  
>
> The `chVTSetI` function has following type: 
>
> ``` 
> typedef vtfunc_t = ptr -> void 
> extern fun chVTSetI (!chss_iclass | cPtr0(virtual_timer_t), systime_t, 
> vtfunc_t, cPtr0(BaseBlockDevice)): void = "mac#" 
> ``` 
>
> The `chVTSetI` uses following `tmrfunc` as 3rd argument: 
>
> ``` 
> extern fun tmrfunc (!chss(chss_isr) | ptr): void = "mac#" 
> ``` 
>
> I would like to write the `chVTSetI` applying as following: 
>
> ``` 
> val () = chVTSetI (pss | tmr_p, MS2ST (POLLING_DELAY), tmrfunc, bbdp) 
> ``` 
>
> However the above code can't be shaped and I should use cast as following, 
> because `typedef` keyword can't define proof argument in the definition: 
>
> ``` 
> val () = chVTSetI (pss | tmr_p, MS2ST (POLLING_DELAY), 
> $UN.cast{vtfunc_t}(tmrfunc), bbdp) 
> ``` 
>
> Are there methods to define envless function typedef includes proof 
> argument? 
>
> Best regards, 
> -- 
> Kiwamu Okabe 
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
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/7403ad1e-d796-4f83-ad64-f3c7180e5907%40googlegroups.com.

Reply via email to