-j
--
On Oct 22, 2016, at 2:19 PM, Matt Harden <matt....@gmail.com> wrote:and [...]int{5}[:] is also illegal (slice of unaddressable value)
When I need to do this, I find it's only a very minor annoyance to define:
func newInt(i int) { return &i }
If Go ever got generics, this would probably be trivial to write generically, for example:
func Ref[T](x T) *T { return &x }
I don't think I'd object if we added a new builtin function called "ref" with the above semantics. It worked pretty well in Limbo as an operator.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
I'd much rather have syntax that just works rather than another built-in function.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
How would new syntax be better than a built-in function with exactly the semantics you are after and shorter to type to boot?
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
I agree with Nate. The consistency in typing is a very compelling argument.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.