I tried to replace extern with static, but the generated C code still had
ATSglobaldec().
static fun foo (): void
implement foo () = ()
I tried to replace extern with static, but the generated C code still had
ATSglobaldec().
static fun foo (): void
implement foo () = ()
It works, thanksOn Monday, December 16, 2013 10:55:05 AM UTC+8, gmhwxi wrote:
Try:
extern
fun foo (): void = “sta#”
implement foo () = ()On Sunday, December 15, 2013 9:44:41 AM UTC-5, Jyun-Yan You wrote:
I tried to replace extern with static, but the generated C code still had
ATSglobaldec().static fun foo (): void
implement foo () = ()
Where is this syntax documented?On Sunday, December 15, 2013 8:55:05 PM UTC-6, gmhwxi wrote:
Try:
extern
fun foo (): void = “sta#”
implement foo () = ()On Sunday, December 15, 2013 9:44:41 AM UTC-5, Jyun-Yan You wrote:
I tried to replace extern with static, but the generated C code still had
ATSglobaldec().static fun foo (): void
implement foo () = ()
‘extern’ in ATS roughly means that the interface declared following it
can be referred to externally/globally.
‘extern’ and ‘static’ do not contradict in ATS; the former refers to
interface
while the latter refers to implementation.On Monday, December 16, 2013 1:47:18 AM UTC-5, Ming Lei wrote:
As a C programmer, I find it counterintuitive that “static” is translated
into “extern”.What’s the meaning of the “extern” keyword in ATS? Why must I use it if
the function declaration and implementation are both in the .dats file, but
not if I put the declaration in a .sats file separately?I’ve read the the entire ATS2 guide (at least what I can find on the Web
site), but I still don’t understand the strange rules of “extern”.On Sunday, December 15, 2013 11:32:23 PM UTC-6, gmhwxi wrote:
The following style of declaration:
static fun foo (): void
is supposed to be automatically translated into the next one:
extern fun foo (): void = “sta#”
I have just added support for doing this, which will be available in the
next release of ATS2.On Sunday, December 15, 2013 9:44:41 AM UTC-5, Jyun-Yan You wrote:
I tried to replace extern with static, but the generated C code still
had ATSglobaldec().static fun foo (): void
implement foo () = ()
The following style of declaration:
static fun foo (): void
is supposed to be automatically translated into the next one:
extern fun foo (): void = “sta#”
I have just added support for doing this, which will be available in the
next release of ATS2.On Sunday, December 15, 2013 9:44:41 AM UTC-5, Jyun-Yan You wrote:
I tried to replace extern with static, but the generated C code still had
ATSglobaldec().static fun foo (): void
implement foo () = ()
This is a considerably obscure feature. I don’t remember documenting it.On Sunday, December 15, 2013 9:44:41 AM UTC-5, Jyun-Yan You wrote:
I tried to replace extern with static, but the generated C code still had
ATSglobaldec().static fun foo (): void
implement foo () = ()
Thanks for the explanation. It makes sense.On Monday, December 16, 2013 1:06:14 PM UTC-6, gmhwxi wrote:
Why must I use it if the function declaration and implementation are
both in the .dats file, but not if I put the declaration in a .sats file
separately?By design, a SATS file is a special case of DATS file in which no
implementations are allowed. Because every declaration in a SATS file is
supposed
to be ‘extern’, the use of ‘extern’ in SATS files is unnecessary and thus
omitted.To some extent, ‘extern’ is like ‘public’ in Java.
On Sunday, December 15, 2013 9:44:41 AM UTC-5, Jyun-Yan You wrote:
I tried to replace extern with static, but the generated C code still had
ATSglobaldec().static fun foo (): void
implement foo () = ()
As a C programmer, I find it counterintuitive that “static” is translated
into “extern”.
What’s the meaning of the “extern” keyword in ATS? Why must I use it if the
function declaration and implementation are both in the .dats file, but not
if I put the declaration in a .sats file separately?
I’ve read the the entire ATS2 guide (at least what I can find on the Web
site), but I still don’t understand the strange rules of “extern”.On Sunday, December 15, 2013 11:32:23 PM UTC-6, gmhwxi wrote:
The following style of declaration:
static fun foo (): void
is supposed to be automatically translated into the next one:
extern fun foo (): void = “sta#”
I have just added support for doing this, which will be available in the
next release of ATS2.On Sunday, December 15, 2013 9:44:41 AM UTC-5, Jyun-Yan You wrote:
I tried to replace extern with static, but the generated C code still had
ATSglobaldec().static fun foo (): void
implement foo () = ()
Try:
extern
fun foo (): void = “sta#”
implement foo () = ()On Sunday, December 15, 2013 9:44:41 AM UTC-5, Jyun-Yan You wrote:
I tried to replace extern with static, but the generated C code still had
ATSglobaldec().static fun foo (): void
implement foo () = ()
Why must I use it if the function declaration and implementation are both
in the .dats file, but not if I put the declaration in a .sats file
separately?
By design, a SATS file is a special case of DATS file in which no
implementations are allowed. Because every declaration in a SATS file is
supposed
to be ‘extern’, the use of ‘extern’ in SATS files is unnecessary and thus
omitted.
To some extent, ‘extern’ is like ‘public’ in Java.On Sunday, December 15, 2013 9:44:41 AM UTC-5, Jyun-Yan You wrote:
I tried to replace extern with static, but the generated C code still had
ATSglobaldec().static fun foo (): void
implement foo () = ()