Re: Union

2016-04-11 Thread JuhiMarcel LangbroekTimmerman
Hi David, Thanks very much for your code, I will try it when I get home at the end of the week although I only have little endian Intell chips. I will have to look around for others. Btw, are there still chips storing big endian paired in two bytes? So your example number would become 0x23, 0x

Re: can a method name contain a funny character?

2016-04-11 Thread Parrot Raiser
I hope I never run across code written by someone who thinks this is a good idea. On 4/11/16, Theo van den Heuvel wrote: > Thanks Larry for the answer and the great language. > > It is quite ok for me to start alphabetically. I use the funny char to > indicate a particular aspect shared by a bunc

Re: can a method name contain a funny character?

2016-04-11 Thread Theo van den Heuvel
Thanks Larry for the answer and the great language. It is quite ok for me to start alphabetically. I use the funny char to indicate a particular aspect shared by a bunch of subs operators and methods. So I tried: method term: { "Mel G.".say } However, that gives me: Bogus postfix Thanks, T

Re: can a method name contain a funny character?

2016-04-11 Thread Larry Wall
You have to write it like this: class Foo { method ::('❤') { "mem heart".say } } my Foo $foo .= new; $foo.'❤'(); Other than that, only names beginning alphabetically are allowed. You could work around this on the caller end with a postfix:<❤>, but that would be an operator,

Re: Union

2016-04-11 Thread David Warring
Hi Marcel, With regard to checking for endianess. I don't think there's anything built in NativeCall that directly determines this, but hopefuly the following should do it, without resorting to a C compiler. use NativeCall; sub little-endian returns Bool { my $i = CArray[uint32].new: 0x0123456

Re: Union

2016-04-11 Thread Marcel Timmerman
Hi Thanks for your answer. I was thinking in perl6, I should have been more  explicit. At the moment I am converting Num to a float representation in my  BSON module and was wondering if there where easier ways and maybe faster too. Regards, Marcel --- Forwarded message --- From: Marcel Ti

Union

2016-04-11 Thread Marcel Timmerman
Hi, While the perl language already offers so much I have a question not found in perl Is there anything like the C union to do an easy mapping from some native variable to a buf of the same number of bytes? This is a nice helper for pack/unpack for native values. It is important to know abo