3 ms·
How come a LISP allows you to write 1/10 instead of (/ 1 10)? Is it a special case for entering fractions, or does Racket allow arbitrary arithmetic expressions
by schoen 11y ago
How come a LISP allows you to write 1/10 instead of (/ 1 10)? Is it a special case for entering fractions, or does Racket allow arbitrary arithmetic expressions with infix operators?
- soegaard 11y ago1/10 is a literal. It denotes the value one tenth. The expression (/ 1 10) will at runtime calculate 1 divided by 10. Most programming languages have syntax for writing all available numbers as literals. Racket do not have builtin syntax for infix arithmetic - but there are various packages available for infix expressions.