Scoped includes and constants .... are....awesome.

On Tuesday, September 25, 2018 at 3:28:05 PM UTC-4, M88 wrote:
>
> Hello,
>
> I was wondering if it's possible to use a template to define the size of a 
> statically allocated array in a template.
>
> An example (that won't compile) is:
>
> extern
> fun {a:t@ype} example () : void
>
> extern
> val {} example$bufsz  : [n:pos] size_t n
>
> implement {a}
> example () =
>     let
>           val sz = example$bufsz<>
>           var buf = @[a?][sz]()
>     in
>     end
>
> Is it possible to define example$bufsz<> as a constant with late-binding?  
> I suppose behavior like sizeof<a> would be ideal, but that seems to be 
> internal.
>
> Thanks,
> -M
>
>
>
>

-- 
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/6450c0ad-f253-4766-9c5e-aa05232c2f8b%40googlegroups.com.

Reply via email to