Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
munificent
on May 20, 2024
|
parent
|
context
|
favorite
| on:
D-Expressions: Lisp power, Dylan style [pdf]
Oh, you still have to worry about precedence. Consider:
var x = 123 print(-x.abs())
Or even:
print(-123.abs())
What do those print? Do they print the same thing?
rileyphone
on May 22, 2024
[–]
Unary operators are still operators. The integer parsing rules are probably different. In Lisp, -x would be a symbol, and the proper analog to -123 would be (- x) eg.
munificent
on May 22, 2024
|
parent
[–]
I think we're in agreement. `-` and `.` are both operators and the language and user have to understand the relative precedence of them.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: