Is it possible to pass primitive types by reference?

711 views
Skip to first unread message

GeneralLuken .

unread,
Nov 25, 2013, 8:11:23 AM11/25/13
to haxe...@googlegroups.com
Hello! Just like in the title - is it possible in haxe to pass primitive types by reference? I would like to reference a string and not copy it.

Sam MacPherson

unread,
Nov 25, 2013, 8:17:19 AM11/25/13
to haxe...@googlegroups.com
As far as I know you can't pass primitive types by reference. Strings are immutable so they shouldn't be copying anyways.

Jason O'Neil

unread,
Nov 25, 2013, 8:21:39 AM11/25/13
to haxe...@googlegroups.com
Hi

Nothing built in to the language that I know of, but tink_core has a pretty cool way of doing it:

https://github.com/haxetink/tink_core#ref
https://github.com/haxetink/tink_core/blob/master/src/tink/core/Ref.hx

Jason



On Mon, Nov 25, 2013 at 9:11 PM, GeneralLuken . <luke...@o2.pl> wrote:
Hello! Just like in the title - is it possible in haxe to pass primitive types by reference? I would like to reference a string and not copy it.

--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages