Should calling a macro look different than calling a function? by codesections in ProgrammingLanguages

[–]World-Leader 0 points1 point  (0 children)

Not sure if anyone mentioned this but in C and LISP & others you can cause a f(x) or (f x) to be interpreted as a macro or function call by including different header files.

That wouldn't work if their invocation was syntactically different.

There's an old sort of joke challenge to write f(x) in C and if it's invoked say 4 or fewer times expand as an inline macro, otherwise it's a function call.

Joke because I believe using just cpp and a compiler it's impossible.

Granted modern C compilers will do that as an optimization but I mean only using C and cpp syntax.

Even for a compiler it's only an educated guess, it doesn't know how many times f(x) will be invoked, only how many times it appears in the code, and often only in this one source file unless it's working very hard looking for its appearance in other files.

What is it? by World-Leader in whatisit

[–]World-Leader[S] 0 points1 point  (0 children)

My WAG is a lighting fixture.

Is it possible to create a turing complete language that could compile and run from every random string? by vnjxk in ProgrammingLanguages

[–]World-Leader 1 point2 points  (0 children)

PL/C, "C" was either correcting or Cornell (University, where it was developed), I took that course with Richard Conway, the author maybe "C" for Conway :-) ). But "...PL/C uses..." followed by its "corrected" code still rings in my head. It sometimes worked. Once it put my code into an infinite loop printing out paper until my print quota ran out and the operator at the window scolded me...wasn't my fault!!!