Y
Hacker News
new
|
ask
|
show
|
jobs
by
JBits
37 days ago
Is there any reason why they're not considering a single '?' like rust? Is it a parsing issue?
So you'd have: obj?:method(…)
1 comments
orthoxerox
37 days ago
Mike Pall wrote in the issue that it's easier to parse. If they get rid of the ternary operator, I'll ask him again to drop the period.
link
nmz
37 days ago
a lone ? can mean anything, you can already tell that . is for fetching a subtable.
link
orthoxerox
37 days ago
In C# it's not a lone ?, it's two operators: ?. and ?[
Lua could have ?. ?[ ?" ?{ and ?(
link
nmz
36 days ago
I'd rather it use ?.() the . means getkey, () means expression using .(expr) should be the same as array[], throwing ? as a character should be very obvious what it does.
link