Why distinguish macro names with @?

I do remember modem noise :slight_smile: But noise is the opposite of signal, the @ carries signal here. It’s the opposite of line noise, which is just extra letters without any useful information.

7 Likes

Yup just extra @'s without useful information.

I wouldn’t put a smiley on being able to remember modem noise.
barfo.

No, it’s just line noise (:wink: )

3 Likes

The @f(...) syntax is unnecessary, and can be argued to be a complication, yet I welcome it with open arms. The alternative for a macro with multiple arguments which each is an expression and do not fit into a line is:

(@f (...) (...)
    (...) (...))

I never programmed in Lisp, but I believe that maybe your nostalgia is being a tad bit strong if you prefer everyone to be forced to write this case this way.

3 Likes

I can hardly believe you are arguing in good faith if you just disregard everyone’s points on why they find that @ transmit useful information and just state the contrary as a fact. If you have an eidetic memory, read the whole Base API, and always read the whole API for every package of every code that you will work with, and therefore remember which identifiers are macros and which aren’t, well, good for you, but the language will not be tailored for your specific use case.

As you mentioned, other languages gone the same path, and it is probably for the same reason; this is, the cost of one extra character dwarfs in comparison with the usefulness of immediately knowing if it is a macro or a function that is being invoked. I have used JuMP which API is mostly macros and I found no problem in typing some @ for extra clarity.

I do imagine that you are also against putting ! at the end of functions that mutate their arguments based on the same principle.

11 Likes

No nostalgia involved, what’s the difference between …

and

@f((...), 
   (...),
   (...),
   (...))

?

extra comma’s in the later maybe?
barfo.

The second version could be:

@f(..., 
   ...,
   ...,
   ...)

No inner parenthesis needed.

1 Like

Assuming the parenthesis were necessary is the first they are necessary in the second.
barfo

ignoring the difference between prefix and infix notation.

for the inner expressions

If you inadvertently push ‘Reply’ before your post is finished, you can click edit (the pencil sign) under your post, to finish it.

4 Likes

yeah…lazy… late here sorry.

And I am just playing devil’s advocate here. I think the language is almost ok. And the implementation has clearly been done well. There are a few things I don’t get, @ being the main one and the “@f …” syntax probably messes with how I think that should work. At a minimum it makes it what I think should happen hard and I don’t understand its benefit.

night night,
barfo.

May I say that I REALLY LOVE this @, which alerts me I am using a macro. As typical scientists, we are most of the time the consumers of macros. And I will take extreme care of these things since it is pretty hard to identify a bug (especially numerically related) involving macros. I feel fortunate that Julia has a tremendous visual hint for macros.

9 Likes

Remember that @jeff.bezanson is a lisper at heart. Here are his reasons for using the @ sigil back in 2010:

27 Likes

It does matter though, because macros aren’t first class. Given (f x), if f is a macro you can’t e.g. use it as an argument to map.

Yes we could live without that.

14 Likes

You can, the variable name should just start with @:

julia> var"@mytime" = var"@time"
@time (macro with 2 methods)

julia> @mytime 123
  0.000001 seconds
123
3 Likes

No idea who @jeff.bezanson is… remember I’m the devil…

  • who cares
  • huh?
  • don’t know why you want this anyway
  • only green on my vt220
  • emacs can figure it out anyway
  • makes no sense at all… if it’s precompiled it’s precompiled, get over it if it goes wrong.

some who knows how, kill off this thread. It’s pointless noise now.
barfo.

True… but that doesn’t explain the need to announce f as a macro. If it is, then (map f …) will fail in some random implementation defined way and it’ll do that whether it’s called ‘f’ or ‘@f’.

At least for the syntax which looks like a function call all you’ve done is add @ to the front of all the names.

I haven’t thought about the other syntax because it would not occur to me to use it.
barfo.

5 Likes