3 ms·
Why not allow both? To resolve ambiguity, there could be keywords CLIKE and PYTHONLIKE which determine how the code is to be parsed from that point, e.g: CL
by cabalamat 18y ago
Why not allow both? To resolve ambiguity, there could be keywords CLIKE and PYTHONLIKE which determine how the code is to be parsed from that point, e.g:
CLIKE
def factorial(x) {
return ( x<=2 ?
1 :
n*factorial(n-1) );
}
PYTHONLIKE
printf(factorial(10)) # note ';' not needed
Incidently I'm writing a language that'll have C-like syntax which will then be compiled into Lisp-like intermediate code. The Lisp-like code will be available to the programmer, who will thus be able to inspect the syntax tree, write Lisp-like macros, etc. Furthermore, the programmer can embed the Lisp-like code inside normal code (like inserting assembler inside a C function).