Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Go Proposal: New(expr) (antonz.org)
1 point by ingve 74 days ago | hide | past | favorite | 2 comments


Honestly, never quite understood the argument against

    &42, &int64(42), &true, etc.
that those have "unintuitive semantics": after all, taking address of compound literals e.g. &Point{X: 42, Y: -34} has been around since Go 1.0 and nobody found those to be confusing, why taking address of primitive literals would be? Oh well.


&42 would not work because constants don’t have a type. But &int64(42) could.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: