Variables in load paths

Sorry if it has been asked before, I will try to update the approrpiate
docs as needed. If you have something like:

staload JNI = “{$JNI}/SATS/jni.sats”

How do you set $JNI? Environment variables seems to not be the answer.

Ah yes, this strange cygwin quoting issue again. I’ll make a note on the
wiki which I’ll hopefully find in case I forget again.
Thanks!On Mon, Jan 19, 2015 at 1:44 PM, Hongwei Xi gmh...@gmail.com wrote:

Try:

patscc -DATS
UNSAFE_targetloc=\"/home/brand_000/ATS-Postiats/prelude/SATS\"
hello.dats

On Mon, Jan 19, 2015 at 1:10 PM, Brandon Barker brandon...@gmail.com wrote:

I seem to be having a bit of trouble with this mechanism still. The
#define works (commented out now), but the command line option shown below
must not be quite right:

brand_000@bbsurfacepro3 ~
$ patscc -DATS
UNSAFE_targetloc=“/home/brand_000/ATS-Postiats/prelude/SATS” hello.dats
patsopt: error(0): the command-line argument
[UNSAFE_targetloc=/home/brand_000/ATS-Postiats/prelude/SATS] cannot be
properly parsed.
exit(ATS): uncaught exception:
_2home_2brand_000_2ATS_2dPostiats_2src_2pats_error_2esats__FatalErrorExn(1025)

brand_000@bbsurfacepro3 ~
$ patscc -DATS
UNSAFE_targetloc="/home/brand_000/ATS-Postiats/prelude/SATS" hello.dats
patsopt: error(0): the command-line argument
[UNSAFE_targetloc=/home/brand_000/ATS-Postiats/prelude/SATS] cannot be
properly parsed.
exit(ATS): uncaught exception:
_2home_2brand_000_2ATS_2dPostiats_2src_2pats_error_2esats__FatalErrorExn(1025)

//#define UNSAFE_targetloc “$PATSHOME/prelude/SATS”

staload UN = “{$UNSAFE}/unsafe.sats”

implement
main0 () = {
val x = $UN.cast2size(7)
val () = println! (“{$UNSAFE}”)
val () = println! (“Hello world!”) // English
val () = println! x
} (* end of [main0] *)

On Wed, Dec 10, 2014 at 12:56 PM, gmhwxi gmh...@gmail.com wrote:

You can also do it this way

patsopt -DATS JNI_targetloc="${JNI}" …

if you set JNI is as an environment variable.

On Wednesday, December 10, 2014 12:33:37 PM UTC-5, gmhwxi wrote:

You can set it as follows:

#define JNI_targetloc “$PATSHOMERELOC/contrib/JNI”

On Wed, Dec 10, 2014 at 12:19 PM, Brandon Barker wrote:

Sorry if it has been asked before, I will try to update the approrpiate

docs as needed. If you have something like:

staload JNI = “{$JNI}/SATS/jni.sats”

How do you set $JNI? Environment variables seems to not be the answer.


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.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/7df46954-3f6f-48e4-999d-bf0c448f7f34%40googlegroups.com
https://groups.google.com/d/msgid/ats-lang-users/7df46954-3f6f-48e4-999d-bf0c448f7f34%40googlegroups.com?utm_medium=email&utm_source=footer
.


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.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpYFTW3_JQapuWQr9zyQ6j%3D6rXH52iKeQ%3DhxJ2avB%3D60w%40mail.gmail.com
https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpYFTW3_JQapuWQr9zyQ6j%3D6rXH52iKeQ%3DhxJ2avB%3D60w%40mail.gmail.com?utm_medium=email&utm_source=footer
.


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.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLpa1rsSj1HTt6cKvevC19LhTMepJ2TUxVKmXbrc-tceUQ%40mail.gmail.com
https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLpa1rsSj1HTt6cKvevC19LhTMepJ2TUxVKmXbrc-tceUQ%40mail.gmail.com?utm_medium=email&utm_source=footer
.

Brandon Barker
brandon...@gmail.com

I tried your source code and encountered no problems.

By the way, JNI_targetloc is already defined in share/atspre_define.hats:

There is no need to define it again unless your new definition is different.On Wednesday, December 10, 2014 1:29:51 PM UTC-5, gmhwxi wrote:

If you can already generate *_dats.c, it means the following line worked:

staload JNI = “{$JNI}/SATS/jni.sats”

On Wed, Dec 10, 2014 at 1:24 PM, Brandon Barker wrote:

I tried this one too, but it seems to be the same (I have attached the
file):

brandon@brandon-OEM ~/ATS-Postiats-contrib/projects/SMALL/Calculator/
Gradle $ echo $JNI
/home/brandon/ATS-Postiats-contrib/contrib/JNI
brandon@brandon-OEM ~/ATS-Postiats-contrib/projects/SMALL/Calculator/
Gradle $ patsopt -DATS JNI_targetloc="${JNI}" -d Calculator.dats |
grep JNI
/home/brandon/ATS-Postiats-contrib/contrib/JNI/SATS/jni.sats:
249(line=15, offs=1) – 284(line=17, offs=3)
#include “JNI/CATS/jni.cats”
ATSdyncst_mac(atscntrb_JNI_GetStringUTFChars)
ATSdyncst_mac(atscntrb_JNI_ReleaseStringUTFChars)
ATSdyncst_mac(atscntrb_JNI_RaiseExceptionByClassName)
ATSINSflab(__patsflab_JNI_eval):
ATSINSmove(tmp960, atscntrb_JNI_GetStringUTFChars(arg0, arg2)) ;
ATSINSmove_void(tmp962, atscntrb_JNI_ReleaseStringUTFChars(arg0, arg2,
tmp960)) ;
ATSINSmove_void(tmp964, atscntrb_JNI_RaiseExceptionByClassName(arg0,
ATSPMVstring(“java/lang/IllegalArgumentException”), ATSPMVstring("
ParsingError"))) ;

On Wednesday, December 10, 2014 12:57:22 PM UTC-5, gmhwxi wrote:

You can also do it this way:

patsopt -DATS JNI_targetloc="${JNI}" …

if you set JNI as an environment variable.

On Wednesday, December 10, 2014 12:19:00 PM UTC-5, Brandon Barker wrote:

Sorry if it has been asked before, I will try to update the approrpiate
docs as needed. If you have something like:

staload JNI = “{$JNI}/SATS/jni.sats”

How do you set $JNI? Environment variables seems to not be the answer.

If you can already generate *_dats.c, it means the following line worked:

staload JNI = "{$JNI}/SATS/jni.sats"On Wed, Dec 10, 2014 at 1:24 PM, Brandon Barker brandon...@gmail.com wrote:

I tried this one too, but it seems to be the same (I have attached the
file):

brandon@brandon-OEM ~/ATS-Postiats-contrib/projects/SMALL/Calculator/
Gradle $ echo $JNI
/home/brandon/ATS-Postiats-contrib/contrib/JNI
brandon@brandon-OEM ~/ATS-Postiats-contrib/projects/SMALL/Calculator/
Gradle $ patsopt -DATS JNI_targetloc="${JNI}" -d Calculator.dats |
grep JNI
/home/brandon/ATS-Postiats-contrib/contrib/JNI/SATS/jni.sats: 249(line=15,
offs=1) – 284(line=17, offs=3)
#include “JNI/CATS/jni.cats”
ATSdyncst_mac(atscntrb_JNI_GetStringUTFChars)
ATSdyncst_mac(atscntrb_JNI_ReleaseStringUTFChars)
ATSdyncst_mac(atscntrb_JNI_RaiseExceptionByClassName)
ATSINSflab(__patsflab_JNI_eval):
ATSINSmove(tmp960, atscntrb_JNI_GetStringUTFChars(arg0, arg2)) ;
ATSINSmove_void(tmp962, atscntrb_JNI_ReleaseStringUTFChars(arg0, arg2,
tmp960)) ;
ATSINSmove_void(tmp964, atscntrb_JNI_RaiseExceptionByClassName(arg0,
ATSPMVstring(“java/lang/IllegalArgumentException”), ATSPMVstring("
ParsingError"))) ;

On Wednesday, December 10, 2014 12:57:22 PM UTC-5, gmhwxi wrote:

You can also do it this way:

patsopt -DATS JNI_targetloc="${JNI}" …

if you set JNI as an environment variable.

On Wednesday, December 10, 2014 12:19:00 PM UTC-5, Brandon Barker wrote:

Sorry if it has been asked before, I will try to update the approrpiate
docs as needed. If you have something like:

staload JNI = “{$JNI}/SATS/jni.sats”

How do you set $JNI? Environment variables seems to not be the answer.


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.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/a3e802b0-ee6d-4d00-9746-433624984b6d%40googlegroups.com
https://groups.google.com/d/msgid/ats-lang-users/a3e802b0-ee6d-4d00-9746-433624984b6d%40googlegroups.com?utm_medium=email&utm_source=footer
.

Try:

patscc -DATS
UNSAFE_targetloc=\"/home/brand_000/ATS-Postiats/prelude/SATS\"
hello.datsOn Mon, Jan 19, 2015 at 1:10 PM, Brandon Barker brandon...@gmail.com wrote:

I seem to be having a bit of trouble with this mechanism still. The
#define works (commented out now), but the command line option shown below
must not be quite right:

brand_000@bbsurfacepro3 ~
$ patscc -DATS
UNSAFE_targetloc=“/home/brand_000/ATS-Postiats/prelude/SATS” hello.dats
patsopt: error(0): the command-line argument
[UNSAFE_targetloc=/home/brand_000/ATS-Postiats/prelude/SATS] cannot be
properly parsed.
exit(ATS): uncaught exception:
_2home_2brand_000_2ATS_2dPostiats_2src_2pats_error_2esats__FatalErrorExn(1025)

brand_000@bbsurfacepro3 ~
$ patscc -DATS
UNSAFE_targetloc="/home/brand_000/ATS-Postiats/prelude/SATS" hello.dats
patsopt: error(0): the command-line argument
[UNSAFE_targetloc=/home/brand_000/ATS-Postiats/prelude/SATS] cannot be
properly parsed.
exit(ATS): uncaught exception:
_2home_2brand_000_2ATS_2dPostiats_2src_2pats_error_2esats__FatalErrorExn(1025)

//#define UNSAFE_targetloc “$PATSHOME/prelude/SATS”

staload UN = “{$UNSAFE}/unsafe.sats”

implement
main0 () = {
val x = $UN.cast2size(7)
val () = println! (“{$UNSAFE}”)
val () = println! (“Hello world!”) // English
val () = println! x
} (* end of [main0] *)

On Wed, Dec 10, 2014 at 12:56 PM, gmhwxi gmh...@gmail.com wrote:

You can also do it this way

patsopt -DATS JNI_targetloc="${JNI}" …

if you set JNI is as an environment variable.

On Wednesday, December 10, 2014 12:33:37 PM UTC-5, gmhwxi wrote:

You can set it as follows:

#define JNI_targetloc “$PATSHOMERELOC/contrib/JNI”

On Wed, Dec 10, 2014 at 12:19 PM, Brandon Barker wrote:

Sorry if it has been asked before, I will try to update the approrpiate

docs as needed. If you have something like:

staload JNI = “{$JNI}/SATS/jni.sats”

How do you set $JNI? Environment variables seems to not be the answer.


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.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/7df46954-3f6f-48e4-999d-bf0c448f7f34%40googlegroups.com
https://groups.google.com/d/msgid/ats-lang-users/7df46954-3f6f-48e4-999d-bf0c448f7f34%40googlegroups.com?utm_medium=email&utm_source=footer
.


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.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpYFTW3_JQapuWQr9zyQ6j%3D6rXH52iKeQ%3DhxJ2avB%3D60w%40mail.gmail.com
https://groups.google.com/d/msgid/ats-lang-users/CAORbNRpYFTW3_JQapuWQr9zyQ6j%3D6rXH52iKeQ%3DhxJ2avB%3D60w%40mail.gmail.com?utm_medium=email&utm_source=footer
.

You can set it as follows:

#define JNI_targetloc “$PATSHOMERELOC/contrib/JNI”

I have three related questions.

Are underscore formally allowed in path variable names? No path variable
use any underscore in the distribution nor in contrib, so I wonder.

What explicitly if a variable is unknown? it is to be left as is or it is
to be substituted an empty string?

Are substitutions to be recursive?

I know I could play with patscc to test, this is just that i prefer
authoritative answers.

You got it :slight_smile:

Please change PATSHOME to PATSHOMERELOC.

In my setting, these two are the same.On Wednesday, December 10, 2014 1:53:46 PM UTC-5, Brandon Barker wrote:

I think I may have spotted a problem but need to step out for a few
minutes:

“${INCLUDE} -IIATS ${PATSHOME}/contrib -I${JNIincl} -c Calculator.dats”
} // end of [Calculator_dats_o]

I think it should be reloc; do you have a symlink there to
ATS-contrib/contrib?

On Wed, Dec 10, 2014 at 1:44 PM, gmhwxi <gmh...@gmail.com <javascript:>> wrote:

I tried your source code and encountered no problems.

By the way, JNI_targetloc is already defined in share/atspre_define.hats:

https://github.com/githwxi/ATS-Postiats/blob/master/share/atspre_define.hats

There is no need to define it again unless your new definition is
different.

On Wednesday, December 10, 2014 1:29:51 PM UTC-5, gmhwxi wrote:

If you can already generate *_dats.c, it means the following line worked:

staload JNI = “{$JNI}/SATS/jni.sats”

On Wed, Dec 10, 2014 at 1:24 PM, Brandon Barker wrote:

I tried this one too, but it seems to be the same (I have attached the
file):

brandon@brandon-OEM ~/ATS-Postiats-contrib/projects/SMALL/Calculator/
Gradle $ echo $JNI
/home/brandon/ATS-Postiats-contrib/contrib/JNI
brandon@brandon-OEM ~/ATS-Postiats-contrib/projects/SMALL/Calculator/
Gradle $ patsopt -DATS JNI_targetloc="${JNI}" -d Calculator.dats |
grep JNI
/home/brandon/ATS-Postiats-contrib/contrib/JNI/SATS/jni.sats:
249(line=15, offs=1) – 284(line=17, offs=3)
#include “JNI/CATS/jni.cats”
ATSdyncst_mac(atscntrb_JNI_GetStringUTFChars)
ATSdyncst_mac(atscntrb_JNI_ReleaseStringUTFChars)
ATSdyncst_mac(atscntrb_JNI_RaiseExceptionByClassName)
ATSINSflab(__patsflab_JNI_eval):
ATSINSmove(tmp960, atscntrb_JNI_GetStringUTFChars(arg0, arg2)) ;
ATSINSmove_void(tmp962, atscntrb_JNI_ReleaseStringUTFChars(arg0, arg2,
tmp960)) ;
ATSINSmove_void(tmp964, atscntrb_JNI_RaiseExceptionByClassName(arg0,
ATSPMVstring(“java/lang/IllegalArgumentException”), ATSPMVstring("
ParsingError"))) ;

On Wednesday, December 10, 2014 12:57:22 PM UTC-5, gmhwxi wrote:

You can also do it this way:

patsopt -DATS JNI_targetloc="${JNI}" …

if you set JNI as an environment variable.

On Wednesday, December 10, 2014 12:19:00 PM UTC-5, Brandon Barker wrote:

Sorry if it has been asked before, I will try to update the
approrpiate docs as needed. If you have something like:

staload JNI = “{$JNI}/SATS/jni.sats”

How do you set $JNI? Environment variables seems to not be the answer.


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...@googlegroups.com <javascript:>.
To post to this group, send email to ats-l...@googlegroups.com
<javascript:>.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/e7fbc06e-c597-4f42-b473-acc81e664371%40googlegroups.com
https://groups.google.com/d/msgid/ats-lang-users/e7fbc06e-c597-4f42-b473-acc81e664371%40googlegroups.com?utm_medium=email&utm_source=footer
.


Brandon Barker
brand...@gmail.com <javascript:>

  1. The character ‘_’ can be used in path names
  2. Say you use $FOO but FOO is not defined (or defined as a non-string),
    the $FOO changes to FOO.
  3. Recursive substitution is not supported (it can be easily supported if
    needed).On Sunday, December 27, 2015 at 5:57:07 PM UTC-5, Yannick Duchêne wrote:

Le mercredi 10 décembre 2014 18:33:37 UTC+1, gmhwxi a écrit :

You can set it as follows:

#define JNI_targetloc “$PATSHOMERELOC/contrib/JNI”

I have three related questions.

Are underscore formally allowed in path variable names? No path variable
use any underscore in the distribution nor in contrib, so I wonder.

What explicitly if a variable is unknown? it is to be left as is or it is
to be substituted an empty string?

Are substitutions to be recursive?

I know I could play with patscc to test, this is just that i prefer
authoritative answers.

I seem to be having a bit of trouble with this mechanism still. The #define
works (commented out now), but the command line option shown below must not
be quite right:

brand_000@bbsurfacepro3 ~
$ patscc -DATS UNSAFE_targetloc=“/home/brand_000/ATS-Postiats/prelude/SATS”
hello.dats
patsopt: error(0): the command-line argument
[UNSAFE_targetloc=/home/brand_000/ATS-Postiats/prelude/SATS] cannot be
properly parsed.
exit(ATS): uncaught exception:
_2home_2brand_000_2ATS_2dPostiats_2src_2pats_error_2esats__FatalErrorExn(1025)

brand_000@bbsurfacepro3 ~
$ patscc -DATS
UNSAFE_targetloc="/home/brand_000/ATS-Postiats/prelude/SATS" hello.dats
patsopt: error(0): the command-line argument
[UNSAFE_targetloc=/home/brand_000/ATS-Postiats/prelude/SATS] cannot be
properly parsed.
exit(ATS): uncaught exception:
_2home_2brand_000_2ATS_2dPostiats_2src_2pats_error_2esats__FatalErrorExn(1025)

//#define UNSAFE_targetloc “$PATSHOME/prelude/SATS”

staload UN = “{$UNSAFE}/unsafe.sats”

implement
main0 () = {
val x = $UN.cast2size(7)
val () = println! (“{$UNSAFE}”)
val () = println! (“Hello world!”) // English
val () = println! x
} (* end of [main0] *)On Wed, Dec 10, 2014 at 12:56 PM, gmhwxi gmh...@gmail.com wrote:

You can also do it this way

patsopt -DATS JNI_targetloc="${JNI}" …

if you set JNI is as an environment variable.

On Wednesday, December 10, 2014 12:33:37 PM UTC-5, gmhwxi wrote:

You can set it as follows:

#define JNI_targetloc “$PATSHOMERELOC/contrib/JNI”

On Wed, Dec 10, 2014 at 12:19 PM, Brandon Barker wrote:

Sorry if it has been asked before, I will try to update the approrpiate

docs as needed. If you have something like:

staload JNI = “{$JNI}/SATS/jni.sats”

How do you set $JNI? Environment variables seems to not be the answer.


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.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/7df46954-3f6f-48e4-999d-bf0c448f7f34%40googlegroups.com
https://groups.google.com/d/msgid/ats-lang-users/7df46954-3f6f-48e4-999d-bf0c448f7f34%40googlegroups.com?utm_medium=email&utm_source=footer
.

Brandon Barker
brandon...@gmail.com

You can set it as follows:

#define JNI_targetloc "$PATSHOMERELOC/contrib/JNI"On Wed, Dec 10, 2014 at 12:19 PM, Brandon Barker brandon...@gmail.com wrote:

Sorry if it has been asked before, I will try to update the approrpiate
docs as needed. If you have something like:

staload JNI = “{$JNI}/SATS/jni.sats”

How do you set $JNI? Environment variables seems to not be the answer.


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.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/10bef205-098c-48c0-85ba-f07b0ab6f76b%40googlegroups.com
https://groups.google.com/d/msgid/ats-lang-users/10bef205-098c-48c0-85ba-f07b0ab6f76b%40googlegroups.com?utm_medium=email&utm_source=footer
.

I tried this one too, but it seems to be the same (I have attached the
file):

brandon@brandon-OEM ~/ATS-Postiats-contrib/projects/SMALL/Calculator/Gradle
$ echo $JNI
/home/brandon/ATS-Postiats-contrib/contrib/JNI
brandon@brandon-OEM ~/ATS-Postiats-contrib/projects/SMALL/Calculator/Gradle
$ patsopt -DATS JNI_targetloc="${JNI}" -d Calculator.dats | grep JNI
/home/brandon/ATS-Postiats-contrib/contrib/JNI/SATS/jni.sats: 249(line=15,
offs=1) – 284(line=17, offs=3)
#include “JNI/CATS/jni.cats”
ATSdyncst_mac(atscntrb_JNI_GetStringUTFChars)
ATSdyncst_mac(atscntrb_JNI_ReleaseStringUTFChars)
ATSdyncst_mac(atscntrb_JNI_RaiseExceptionByClassName)
ATSINSflab(__patsflab_JNI_eval):
ATSINSmove(tmp960, atscntrb_JNI_GetStringUTFChars(arg0, arg2)) ;
ATSINSmove_void(tmp962, atscntrb_JNI_ReleaseStringUTFChars(arg0, arg2,
tmp960)) ;
ATSINSmove_void(tmp964, atscntrb_JNI_RaiseExceptionByClassName(arg0,
ATSPMVstring(“java/lang/IllegalArgumentException”), ATSPMVstring("
ParsingError"))) ;On Wednesday, December 10, 2014 12:57:22 PM UTC-5, gmhwxi wrote:

You can also do it this way:

patsopt -DATS JNI_targetloc="${JNI}" …

if you set JNI as an environment variable.

On Wednesday, December 10, 2014 12:19:00 PM UTC-5, Brandon Barker wrote:

Sorry if it has been asked before, I will try to update the approrpiate
docs as needed. If you have something like:

staload JNI = “{$JNI}/SATS/jni.sats”

How do you set $JNI? Environment variables seems to not be the answer.

Calculator.dats (2.29 KB)

Calculator_dats.c (781 KB)

If you paste your code here, then we should be able to find out.On Wednesday, December 10, 2014 1:12:24 PM UTC-5, Brandon Barker wrote:

It seems to be correct in the environment:

echo $PATSHOMERELOC
/home/brandon/ATS-Postiats-contrib

On Wed, Dec 10, 2014 at 1:05 PM, gmhwxi <gmh...@gmail.com <javascript:>> wrote:

Maybe PATSHOMERELOC was not properly set.

On Wednesday, December 10, 2014 12:55:10 PM UTC-5, Brandon Barker wrote:

I defined this in e.g Gradle/Calculator.dats (trying several
permutations of fulling expanding $PATSHOMERELOC and setting within %{^ %})
to no avail.

On Wednesday, December 10, 2014 12:33:37 PM UTC-5, gmhwxi wrote:

You can set it as follows:

#define JNI_targetloc “$PATSHOMERELOC/contrib/JNI”

On Wed, Dec 10, 2014 at 12:19 PM, Brandon Barker brand...@gmail.com wrote:

Sorry if it has been asked before, I will try to update the
approrpiate docs as needed. If you have something like:

staload JNI = “{$JNI}/SATS/jni.sats”

How do you set $JNI? Environment variables seems to not be the answer.


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...@googlegroups.com.
To post to this group, send email to ats-l...@googlegroups.com.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit https://groups.google.com/d/
msgid/ats-lang-users/10bef205-098c-48c0-85ba-f07b0ab6f76b%
40googlegroups.com
https://groups.google.com/d/msgid/ats-lang-users/10bef205-098c-48c0-85ba-f07b0ab6f76b%40googlegroups.com?utm_medium=email&utm_source=footer
.


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...@googlegroups.com <javascript:>.
To post to this group, send email to ats-l...@googlegroups.com
<javascript:>.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/70ed9a31-c0db-43d4-b217-e6dbff5b2824%40googlegroups.com
https://groups.google.com/d/msgid/ats-lang-users/70ed9a31-c0db-43d4-b217-e6dbff5b2824%40googlegroups.com?utm_medium=email&utm_source=footer
.


Brandon Barker
brand...@gmail.com <javascript:>

You can also do it this way:

patsopt -DATS JNI_targetloc="${JNI}" …

if you set JNI as an environment variable.On Wednesday, December 10, 2014 12:19:00 PM UTC-5, Brandon Barker wrote:

Sorry if it has been asked before, I will try to update the approrpiate
docs as needed. If you have something like:

staload JNI = “{$JNI}/SATS/jni.sats”

How do you set $JNI? Environment variables seems to not be the answer.

FYI. I have fixed it in the Github.On Wednesday, December 10, 2014 2:02:13 PM UTC-5, gmhwxi wrote:

You got it :slight_smile:

Please change PATSHOME to PATSHOMERELOC.

In my setting, these two are the same.

On Wednesday, December 10, 2014 1:53:46 PM UTC-5, Brandon Barker wrote:

I think I may have spotted a problem but need to step out for a few
minutes:

“${INCLUDE} -IIATS ${PATSHOME}/contrib -I${JNIincl} -c Calculator.dats”
} // end of [Calculator_dats_o]

I think it should be reloc; do you have a symlink there to
ATS-contrib/contrib?

On Wed, Dec 10, 2014 at 1:44 PM, gmhwxi gmh...@gmail.com wrote:

I tried your source code and encountered no problems.

By the way, JNI_targetloc is already defined in share/atspre_define.hats:

https://github.com/githwxi/ATS-Postiats/blob/master/share/atspre_define.hats

There is no need to define it again unless your new definition is
different.

On Wednesday, December 10, 2014 1:29:51 PM UTC-5, gmhwxi wrote:

If you can already generate *_dats.c, it means the following line
worked:

staload JNI = “{$JNI}/SATS/jni.sats”

On Wed, Dec 10, 2014 at 1:24 PM, Brandon Barker wrote:

I tried this one too, but it seems to be the same (I have attached the
file):

brandon@brandon-OEM ~/ATS-Postiats-contrib/projects/SMALL/Calculator/
Gradle $ echo $JNI
/home/brandon/ATS-Postiats-contrib/contrib/JNI
brandon@brandon-OEM ~/ATS-Postiats-contrib/projects/SMALL/Calculator/
Gradle $ patsopt -DATS JNI_targetloc="${JNI}" -d Calculator.dats |
grep JNI
/home/brandon/ATS-Postiats-contrib/contrib/JNI/SATS/jni.sats:
249(line=15, offs=1) – 284(line=17, offs=3)
#include “JNI/CATS/jni.cats”
ATSdyncst_mac(atscntrb_JNI_GetStringUTFChars)
ATSdyncst_mac(atscntrb_JNI_ReleaseStringUTFChars)
ATSdyncst_mac(atscntrb_JNI_RaiseExceptionByClassName)
ATSINSflab(__patsflab_JNI_eval):
ATSINSmove(tmp960, atscntrb_JNI_GetStringUTFChars(arg0, arg2)) ;
ATSINSmove_void(tmp962, atscntrb_JNI_ReleaseStringUTFChars(arg0,
arg2, tmp960)) ;
ATSINSmove_void(tmp964, atscntrb_JNI_RaiseExceptionByClassName(arg0,
ATSPMVstring(“java/lang/IllegalArgumentException”), ATSPMVstring("
ParsingError"))) ;

On Wednesday, December 10, 2014 12:57:22 PM UTC-5, gmhwxi wrote:

You can also do it this way:

patsopt -DATS JNI_targetloc="${JNI}" …

if you set JNI as an environment variable.

On Wednesday, December 10, 2014 12:19:00 PM UTC-5, Brandon Barker wrote:

Sorry if it has been asked before, I will try to update the
approrpiate docs as needed. If you have something like:

staload JNI = “{$JNI}/SATS/jni.sats”

How do you set $JNI? Environment variables seems to not be the
answer.


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...@googlegroups.com.
To post to this group, send email to ats-l...@googlegroups.com.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/e7fbc06e-c597-4f42-b473-acc81e664371%40googlegroups.com
https://groups.google.com/d/msgid/ats-lang-users/e7fbc06e-c597-4f42-b473-acc81e664371%40googlegroups.com?utm_medium=email&utm_source=footer
.


Brandon Barker
brand...@gmail.com

  1. The character ‘_’ can be used in path names

Path variable names, I assume.

  1. Say you use $FOO but FOO is not defined (or defined as a non-string),
    the $FOO changes to FOO.

Okay.

  1. Recursive substitution is not supported (it can be easily supported if
    needed).

That’s OK, not an issue. This is just for a tool which needs to be able
to locate file the same way Postiats do, and it was worth to ask for
documentation too.

I defined this in e.g Gradle/Calculator.dats (trying several permutations
of fulling expanding $PATSHOMERELOC and setting within %{^ %}) to no avail.On Wednesday, December 10, 2014 12:33:37 PM UTC-5, gmhwxi wrote:

You can set it as follows:

#define JNI_targetloc “$PATSHOMERELOC/contrib/JNI”

On Wed, Dec 10, 2014 at 12:19 PM, Brandon Barker <brand...@gmail.com <javascript:>> wrote:

Sorry if it has been asked before, I will try to update the approrpiate
docs as needed. If you have something like:

staload JNI = “{$JNI}/SATS/jni.sats”

How do you set $JNI? Environment variables seems to not be the answer.


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...@googlegroups.com <javascript:>.
To post to this group, send email to ats-l...@googlegroups.com
<javascript:>.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/10bef205-098c-48c0-85ba-f07b0ab6f76b%40googlegroups.com
https://groups.google.com/d/msgid/ats-lang-users/10bef205-098c-48c0-85ba-f07b0ab6f76b%40googlegroups.com?utm_medium=email&utm_source=footer
.

I changed the implementation a bit to support recursive substitution;
the maximal recursion depth is set to be 100.On Monday, December 28, 2015 at 2:26:44 AM UTC-5, Yannick Duchêne wrote:

Le lundi 28 décembre 2015 04:36:57 UTC+1, gmhwxi a écrit :

  1. The character ‘_’ can be used in path names

Path variable names, I assume.

  1. Say you use $FOO but FOO is not defined (or defined as a non-string),
    the $FOO changes to FOO.

Okay.

  1. Recursive substitution is not supported (it can be easily supported if
    needed).

That’s OK, not an issue. This is just for a tool which needs to be able
to locate file the same way Postiats do, and it was worth to ask for
documentation too.

Maybe PATSHOMERELOC was not properly set.On Wednesday, December 10, 2014 12:55:10 PM UTC-5, Brandon Barker wrote:

I defined this in e.g Gradle/Calculator.dats (trying several permutations
of fulling expanding $PATSHOMERELOC and setting within %{^ %}) to no avail.

On Wednesday, December 10, 2014 12:33:37 PM UTC-5, gmhwxi wrote:

You can set it as follows:

#define JNI_targetloc “$PATSHOMERELOC/contrib/JNI”

On Wed, Dec 10, 2014 at 12:19 PM, Brandon Barker brand...@gmail.com wrote:

Sorry if it has been asked before, I will try to update the approrpiate
docs as needed. If you have something like:

staload JNI = “{$JNI}/SATS/jni.sats”

How do you set $JNI? Environment variables seems to not be the answer.


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...@googlegroups.com.
To post to this group, send email to ats-l...@googlegroups.com.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/10bef205-098c-48c0-85ba-f07b0ab6f76b%40googlegroups.com
https://groups.google.com/d/msgid/ats-lang-users/10bef205-098c-48c0-85ba-f07b0ab6f76b%40googlegroups.com?utm_medium=email&utm_source=footer
.

It seems to be correct in the environment:

echo $PATSHOMERELOC
/home/brandon/ATS-Postiats-contribOn Wed, Dec 10, 2014 at 1:05 PM, gmhwxi gmh...@gmail.com wrote:

Maybe PATSHOMERELOC was not properly set.

On Wednesday, December 10, 2014 12:55:10 PM UTC-5, Brandon Barker wrote:

I defined this in e.g Gradle/Calculator.dats (trying several permutations
of fulling expanding $PATSHOMERELOC and setting within %{^ %}) to no avail.

On Wednesday, December 10, 2014 12:33:37 PM UTC-5, gmhwxi wrote:

You can set it as follows:

#define JNI_targetloc “$PATSHOMERELOC/contrib/JNI”

On Wed, Dec 10, 2014 at 12:19 PM, Brandon Barker brand...@gmail.com wrote:

Sorry if it has been asked before, I will try to update the approrpiate
docs as needed. If you have something like:

staload JNI = “{$JNI}/SATS/jni.sats”

How do you set $JNI? Environment variables seems to not be the answer.


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...@googlegroups.com.
To post to this group, send email to ats-l...@googlegroups.com.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit https://groups.google.com/d/
msgid/ats-lang-users/10bef205-098c-48c0-85ba-f07b0ab6f76b%
40googlegroups.com
https://groups.google.com/d/msgid/ats-lang-users/10bef205-098c-48c0-85ba-f07b0ab6f76b%40googlegroups.com?utm_medium=email&utm_source=footer
.


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.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/70ed9a31-c0db-43d4-b217-e6dbff5b2824%40googlegroups.com
https://groups.google.com/d/msgid/ats-lang-users/70ed9a31-c0db-43d4-b217-e6dbff5b2824%40googlegroups.com?utm_medium=email&utm_source=footer
.

Brandon Barker
brandon...@gmail.com

I think I may have spotted a problem but need to step out for a few minutes:

“${INCLUDE} -IIATS ${PATSHOME}/contrib -I${JNIincl} -c Calculator.dats”
} // end of [Calculator_dats_o]

I think it should be reloc; do you have a symlink there to
ATS-contrib/contrib?On Wed, Dec 10, 2014 at 1:44 PM, gmhwxi gmh...@gmail.com wrote:

I tried your source code and encountered no problems.

By the way, JNI_targetloc is already defined in share/atspre_define.hats:

https://github.com/githwxi/ATS-Postiats/blob/master/share/atspre_define.hats

There is no need to define it again unless your new definition is
different.

On Wednesday, December 10, 2014 1:29:51 PM UTC-5, gmhwxi wrote:

If you can already generate *_dats.c, it means the following line worked:

staload JNI = “{$JNI}/SATS/jni.sats”

On Wed, Dec 10, 2014 at 1:24 PM, Brandon Barker wrote:

I tried this one too, but it seems to be the same (I have attached the
file):

brandon@brandon-OEM ~/ATS-Postiats-contrib/projects/SMALL/Calculator/
Gradle $ echo $JNI
/home/brandon/ATS-Postiats-contrib/contrib/JNI
brandon@brandon-OEM ~/ATS-Postiats-contrib/projects/SMALL/Calculator/
Gradle $ patsopt -DATS JNI_targetloc="${JNI}" -d Calculator.dats |
grep JNI
/home/brandon/ATS-Postiats-contrib/contrib/JNI/SATS/jni.sats:
249(line=15, offs=1) – 284(line=17, offs=3)
#include “JNI/CATS/jni.cats”
ATSdyncst_mac(atscntrb_JNI_GetStringUTFChars)
ATSdyncst_mac(atscntrb_JNI_ReleaseStringUTFChars)
ATSdyncst_mac(atscntrb_JNI_RaiseExceptionByClassName)
ATSINSflab(__patsflab_JNI_eval):
ATSINSmove(tmp960, atscntrb_JNI_GetStringUTFChars(arg0, arg2)) ;
ATSINSmove_void(tmp962, atscntrb_JNI_ReleaseStringUTFChars(arg0, arg2,
tmp960)) ;
ATSINSmove_void(tmp964, atscntrb_JNI_RaiseExceptionByClassName(arg0,
ATSPMVstring(“java/lang/IllegalArgumentException”), ATSPMVstring("
ParsingError"))) ;

On Wednesday, December 10, 2014 12:57:22 PM UTC-5, gmhwxi wrote:

You can also do it this way:

patsopt -DATS JNI_targetloc="${JNI}" …

if you set JNI as an environment variable.

On Wednesday, December 10, 2014 12:19:00 PM UTC-5, Brandon Barker wrote:

Sorry if it has been asked before, I will try to update the
approrpiate docs as needed. If you have something like:

staload JNI = “{$JNI}/SATS/jni.sats”

How do you set $JNI? Environment variables seems to not be the answer.


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.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/e7fbc06e-c597-4f42-b473-acc81e664371%40googlegroups.com
https://groups.google.com/d/msgid/ats-lang-users/e7fbc06e-c597-4f42-b473-acc81e664371%40googlegroups.com?utm_medium=email&utm_source=footer
.

Brandon Barker
brandon...@gmail.com