How to model C macro defined constants?

48 views
Skip to first unread message

H Zhang

unread,
Jan 23, 2014, 1:43:26 PM1/23/14
to ats-lan...@googlegroups.com
Following this book section http://www.ats-lang.org/DOCUMENT/INT2PROGINATS/HTML/x2038.html I tried:

macdef RTLD_GLOBAL = $extype(int, "RTLD_GLOBAL")

But patsopt complained:

/home/haitao/pugi-store/pl_dlcall.dats: 201(line=5, offs=22) -- 208(line=5, offs=29): error(parsing): the syntactic entity [d0exp] is needed.

Haitao

Brandon Barker

unread,
Jan 23, 2014, 1:48:02 PM1/23/14
to ats-lan...@googlegroups.com
I wonder if it matters if this is a #define'd variable or not.

Brandon Barker

unread,
Jan 23, 2014, 1:58:59 PM1/23/14
to ats-lan...@googlegroups.com
apparently it doesn't matter, I tested both cases.

Brandon Barker
brandon...@gmail.com


--
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-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/7f9f4c8b-73b8-4f60-ab35-7c8a2d08cf02%40googlegroups.com.

H Zhang

unread,
Jan 23, 2014, 2:08:45 PM1/23/14
to ats-lan...@googlegroups.com
Apparently it is a syntax error so I assume some syntax has changed and the book section is not up-to-date?

Brandon Barker

unread,
Jan 23, 2014, 2:17:45 PM1/23/14
to ats-lan...@googlegroups.com
I think it is a typo: extval seems to work, not extype in this case.

H Zhang

unread,
Jan 23, 2014, 2:24:14 PM1/23/14
to ats-lan...@googlegroups.com
Okay I will use extval for now. At least it now parses. Thanks!

Brandon Barker

unread,
Jan 23, 2014, 2:39:09 PM1/23/14
to ats-lan...@googlegroups.com
Yeah, the above line in that book even says extval (highlighted in red - not sure how I missed it). I was able to run a program making use of this.

Haitao Zhang

unread,
Mar 19, 2014, 11:39:35 AM3/19/14
to ats-lan...@googlegroups.com
Hongwei,

You mentioned you are interested in fixing bugs by your students. Here is one that is in the demo code in the introduction book and I just checked that it is still there. All $exttype should really be $extval in the lower half of the page:

http://www.ats-lang.org/DOCUMENT/INT2PROGINATS/HTML/x2038.html

Haitao


--
You received this message because you are subscribed to a topic in the Google Groups "ats-lang-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ats-lang-users/HpryPGywycg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ats-lang-user...@googlegroups.com.

To post to this group, send email to ats-lan...@googlegroups.com.

gmhwxi

unread,
Mar 19, 2014, 12:29:53 PM3/19/14
to ats-lan...@googlegroups.com
Thanks! Fixed.
Reply all
Reply to author
Forward
0 new messages