Arc Forumnew | comments | leaders | submitlogin
At-sign in string
5 points by prestonbriggs 100 days ago | 5 comments
I try something like

  (prn "   .global   @zap")
and I get a complaint about the at-sign. Why's that?

I find that quoting the string, like this

  (prn '"    .global    @zap")
works like I'd hope.

Thanks, Preston



4 points by akkartik 100 days ago | link

Congratulations, you've run into at-strings, one of Arc's more awkward features.

Prior discussions: http://arclanguage.org/item?id=10245; http://arclanguage.org/item?id=10485; http://arclanguage.org/item?id=18715

Interesting idea to quote a string. I'd somehow never thought of that!

-----

3 points by prestonbriggs 100 days ago | link

Got it, thanks.

I guess the quote idea came from me thinking that the strings were being evaluated. My untrained mind thought "strings evaluate to themselves", but apparently not. So I used the single quote to prevent evaluation.

-----

1 point by akkartik 100 days ago | link

And it worked! Nicely done.

-----

3 points by jsgrahamus 91 days ago | link

When I try this in Arc 3.1, I get no complaints.

-----

3 points by akkartik 90 days ago | link

Yes, the atstrings feature is turned off by default in Arc 3.1 (and also in Anarki's official/stable branches). I think I'll turn off the default in Anarki as well, and just let news.arc continue to make use of it.

Edit 1 hour later: This is now done. Turns out Anarki never meant to turn on atstrings by default. This was a side effect of loading news.arc by default (mea culpa). I've changed things so we load news.arc by default but only use atstrings in news.arc by default. Keep an eye out for subtle bugs introduced by atstrings being turned off when functions in news.arc are called. If we see any I'll probably take out the ability to turn it on and off and just decide to keep it everywhere or take it out entirely.

https://github.com/arclanguage/anarki/commit/d0eb0dcf17

-----