Arc Forumnew | comments | leaders | submitlogin
foo!bar syntax interferes with function naming
4 points by cooldude127 6118 days ago | 5 comments
The added foo!bar -> (foo 'bar) syntax is nice, but it seems to prevent the naming of functions like fill-array!. This isn't so much a problem, but it seems to disguise the problem. Arc doesn't complain if you define such a function until you try to use the function, in which case it is undefined.


3 points by cadaver 6118 days ago | link

I don't think intrasymbol notation should necessarily keep one from using special intrasymbol characters at the end of function names, even though currently it does.

By the way:

  arc> (bound 'fill-array!)
  nil
  arc> (def fill-array! parms parms)
  #<procedure: fill-array!>
  arc> (bound 'fill-array!)
  t
  arc> (ssexpand 'fill-array!)
  (fill-array (quote #<eof>))
Although I don't know how you can get at the fill-array! function, defined it is.

-----

2 points by raymyers 6118 days ago | link

Hey look, another thing the interpreter sees as EOF. Other favorites include "\!" and ".a".

-----

5 points by pg 6118 days ago | link

It doesn't seem a good idea to use characters that have special syntactic meaning in the names of things. You can't name a function foo(bar either, but that doesn't seem odd because Lisp hackers are used to ( being different from other characters.

-----

4 points by cadaver 6118 days ago | link

It seems too that special end-of-symbol handling in the core, just because some users might possibly want to use intrasymbol-notation characters at the end of function names, does not go well with Arc's design philosophy:

... avoid having a language designed according to arbitrary rules rather than the actual demands of the task ...

http://www.arclanguage.com/item?id=2555

Good philosophy I think.

-----

1 point by tel 6117 days ago | link

This is potentially an issue if you open up intrasymbol syntax though. It'd be pathologically dumb, but what happens if I set up - to be an intrasymbol macro?

Solution: perhaps user defined intrasymbol macros should be surrounded by colons (:-:) by convention? Do intrasymbol macros support multiple characters?

-----