Re: can a method name contain a funny character?

2016-05-21 Thread yary
Thanks for the in-depth analysis. My misunderstanding was about what an
identifier considers a number; I have no well-thought-out ideas on the
subject of what an identifier ought to be.

Having the docs mention that "number" means only characters with a Unicode
Property GeneralCategory of Nd might have prevented me from looking through
the NumericTypes for a pattern. With more experimenting, I might have
noticed that De was the one that always worked, since De has a one-to-one
correspondence with Nd...

-y


Re: can a method name contain a funny character?

2016-05-21 Thread Larry Wall
On Fri, May 20, 2016 at 09:39:30AM -0400, yary wrote:
: On Tue, Apr 12, 2016 at 6:12 PM, Brandon Allbery 
: wrote:
: > I was explaining why some "symbols" are acceptable to the parser. Which
: one
: > is more appropriate is not my call,
: 
: I was thinking about what exactly are valid identifiers in Perl6/rakudo's
: implementation. The docs 
: say:
: 
: An identifier is a primitive name, and must start with an alphabetic
: character (or an underscore), followed by zero or more word characters
: (alphabetic, underscore or number). You can also embed dashes - or single
: quotes ' in the middle, but not two in a row.

At this point, "number" means only characters with a GeneralCategory
of Nd.  We could talk about generalizing that, but there are potential
issues.  We can't simply extend it to No characters, because then

pi²

would misparse as a 3-character identifier.

: Experimenting with some of the numeric codes from Wikipedia
: , some of the numeric
: codes seem inconsistent-

Note that, even if we used this table, we could not distinguish ² from ② and 
such.

: > my $_६೬ퟨ = ६೬ퟨ # "De" Devanagari, Kannada, Mathematical. "De" is all
: good.
: 666

That's fine, those work because of the Nd general property, so they're 
equivalent
to 0..9 as far as we're concerned.

: > my $x六 = 6 #  "Nu" Han number 6
: 6
: >  say 六
: ===SORRY!=== ...

Note that 六 works in identifiers by virtue of being not numeric at all,
but by being in general category Lo, that is, it's a "letter other",
so considered alphabetic.

: > say ௰  # "Nu" Tamil number 10
: 10
: > my $x௰ = 5
: ===SORRY!=== Error ...

Excluded because it's No, not Nd.

: > say ① + 3 # "Di" 1 in typographic context has value 1
: 4
: > my $b① = 44 "Di" 1 not valid in identifier
: ===SORRY!=== Error ...

① is indistinguishable from superscripts, even by "Di", and falls into
the No general category, so excluded.

: Some numeric codepoints are recognized as such, yet Rakudo isn't allowing
: them in identifiers. Especially confounding is the treatment of the "Han
: number 6" and "Tamil number 10", both of which are unicode "Nu" numeric.
: The Tamil is recognized as a number on its own but not as an identifier;
: the Han is allowed in an identifier but isn't recognized as a number!

We currently rely only on GeneralCategory.  I don't believe we use
NumericType anywhere in parsing Perl 6.

: Is there some deeper rule at work here- which could be added to the
: documentation? Or are these bugs?

Not a bug, but potentially negotiable.  It simply comes down to Nd vs
No at the moment.  One could argue that we could notice superscripts
as a separate category and treat them differently, but there are two
arguments against that.

The first is that we'd like to keep the basic identifier rules fairly
simple.  We're already pushing the state of the art here, and I don't
see much benefit in making the rules more arcane that they are.

The second argument is that we should probably reserve syntax for the
user here.  Once we get slangs fully hooked up, we can easily let users
define identifiers to include ①  and such.  But it's just as likely,
perhaps more likely, that the user will want to use ①  for a postfix,
just like we currently treat superscripts as powers.  We can't guess
(well, we *could* guess, but can't know) which way the user will want to
use these, so the conservative approach is to make neither of them work,
and let the user take an additive approach, rather than forcing them to
use a subtractive approach if we guessed wrong.

Larry


Re: can a method name contain a funny character?

2016-05-20 Thread yary
To be clear, I expect that "number" in "followed by zero or more word
characters (alphabetic, underscore or number)" means "if Unicode thinks
it's numeric, you can use it in an identifier after the first character."

I don't expect that every numeric codepoint in Unicode must evaluate to
number in the Perl6 settings. We can have Numeric::Roman,
Numeric::Counting-Rod, Numeric::Euler etc. for those, if someone cares
enough to write & use them.


Re: can a method name contain a funny character?

2016-05-20 Thread yary
On Tue, Apr 12, 2016 at 6:12 PM, Brandon Allbery 
wrote:
> I was explaining why some "symbols" are acceptable to the parser. Which
one
> is more appropriate is not my call,

I was thinking about what exactly are valid identifiers in Perl6/rakudo's
implementation. The docs 
say:

An identifier is a primitive name, and must start with an alphabetic
character (or an underscore), followed by zero or more word characters
(alphabetic, underscore or number). You can also embed dashes - or single
quotes ' in the middle, but not two in a row.


Experimenting with some of the numeric codes from Wikipedia
, some of the numeric
codes seem inconsistent-

> my $_६೬ퟨ = ६೬ퟨ # "De" Devanagari, Kannada, Mathematical. "De" is all
good.
666

> my $x六 = 6 #  "Nu" Han number 6
6
>  say 六
===SORRY!=== ...
> say ௰  # "Nu" Tamil number 10
10
> my $x௰ = 5
===SORRY!=== Error ...

> say ① + 3 # "Di" 1 in typographic context has value 1
4
> my $b① = 44 "Di" 1 not valid in identifier
===SORRY!=== Error ...

Some numeric codepoints are recognized as such, yet Rakudo isn't allowing
them in identifiers. Especially confounding is the treatment of the "Han
number 6" and "Tamil number 10", both of which are unicode "Nu" numeric.
The Tamil is recognized as a number on its own but not as an identifier;
the Han is allowed in an identifier but isn't recognized as a number!

Is there some deeper rule at work here- which could be added to the
documentation? Or are these bugs?

-y


Re: can a method name contain a funny character?

2016-04-12 Thread Brandon Allbery
On Tue, Apr 12, 2016 at 6:07 PM, Darren Duncan 
wrote:

> On 2016-04-12 6:59 AM, Brandon Allbery wrote:
>
>> On Tue, Apr 12, 2016 at 9:51 AM, Brock Wilcox 
>> wrote:
>> Heart doesn't work for me, but other symbols seem fine. I don't know
>> why. I
>> also didn't need to quote them. Here is a REPL session from a Rakudo
>> 2016.01.1:
>>
>>  > sub Δ($x) { say "got $x" }
>>
>> Δ is a perfectly valid letter in the Greek alphabet. Unicode doesn't care
>> that
>> you prefer to think of it as a symbol.
>>
>
> On the other hand, Unicode has a lot of actual Mathematical Symbols for
> stuff like this, so you don't have to use what it considers Greek letters
> when you mean symbols.
> For example, ∆ is U+2206 named INCREMENT.
> Is that not better, or is an actual Greek letter desired in the above
> example?
>

I was explaining why some "symbols" are acceptable to the parser. Which one
is more appropriate is not my call, although arguably for the original
poster's use the one that doesn't need magic might be more appropriate (at
least until someone who wants to program in Greek wants to use it!).

-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net


Re: can a method name contain a funny character?

2016-04-12 Thread Darren Duncan

On 2016-04-12 6:59 AM, Brandon Allbery wrote:

On Tue, Apr 12, 2016 at 9:51 AM, Brock Wilcox  
wrote:
Heart doesn't work for me, but other symbols seem fine. I don't know why. I
also didn't need to quote them. Here is a REPL session from a Rakudo 
2016.01.1:

 > sub Δ($x) { say "got $x" }

Δ is a perfectly valid letter in the Greek alphabet. Unicode doesn't care that
you prefer to think of it as a symbol.


On the other hand, Unicode has a lot of actual Mathematical Symbols for stuff 
like this, so you don't have to use what it considers Greek letters when you 
mean symbols.


For example, ∆ is U+2206 named INCREMENT.

Is that not better, or is an actual Greek letter desired in the above example?

-- Darren Duncan



Re: can a method name contain a funny character?

2016-04-12 Thread Parrot Raiser
If we don't want to get the "line noise" libel all over again, there
are some features of the language that should probably go unmentioned
for a while. The ability to use non-ASCII characters in names may be
perfectly justifiable. When the cognoscenti have produced enough
decent code showing how to use the feature properly, it will be time
to admit to it. Just because you can play the accordion is no reason
to tell everyone about it. :-)*

On 4/12/16, Theo van den Heuvel  wrote:
> Thanks again, I get it now.
> Theo
>
> Larry Wall schreef op 2016-04-12 17:00:
>> On Mon, Apr 11, 2016 at 11:32:29PM +0200, 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 bunch of subs operators
>> : and methods.
>> : So I tried:
>> :
>> : method term: { "Mel G.".say }
>> :
>> : However, that gives me:
>> :
>> : Bogus postfix
>>
>> Because it *is* a bogus postfix.  Nobody defined a postfix, so to the
>> parser, there's just random unicode gobbledygook after the dot.
>> Defining
>> a term only adds to the list of things the grammar recognizes when a
>> *term* is expected.  A term is not expected right after another term.
>> That's where a postfix or an infix is expected.  A term is expected
>> only at the beginning of an expression, or after an infix.  You can't
>> mix together terms and postfixes; their namespaces and usages entirely
>> disjunct.  Grammatical categories are very important to the
>> extensibility
>> of the parser, so that's not something we're going to try to guess at.
>>
>> On top of which, method names are off in the class's metaobject,
>> and don't participate in operator naming at all.  They have different
>> dispatchers: the operator is dispatched using the current set of nested
>> lexical scopes, while method calls are dispatched using the object's
>> set of parents and metaobjects.  This is how we keep OO from colliding
>> with functional programming.  You can make a method with any name you
>> like if you try hard enough, but that doesn't mean you can create
>> random
>> associations with an operator or term throughout your program.  The
>> scope
>> of the term you defined above will only be the lexical scope of the
>> class
>> itself, and it won't get exported to the place you are wanting to use
>> it,
>> even if you could use a term in postfix position, which you can't.
>>
>> Sorry I can't write more clearly this early in the morning...  :)
>>
>> Larry
>
>


Re: can a method name contain a funny character?

2016-04-12 Thread Theo van den Heuvel

Thanks again, I get it now.
Theo

Larry Wall schreef op 2016-04-12 17:00:

On Mon, Apr 11, 2016 at 11:32:29PM +0200, 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 bunch of subs operators
: and methods.
: So I tried:
:
: method term: { "Mel G.".say }
:
: However, that gives me:
:
: Bogus postfix

Because it *is* a bogus postfix.  Nobody defined a postfix, so to the
parser, there's just random unicode gobbledygook after the dot.  
Defining

a term only adds to the list of things the grammar recognizes when a
*term* is expected.  A term is not expected right after another term.
That's where a postfix or an infix is expected.  A term is expected
only at the beginning of an expression, or after an infix.  You can't
mix together terms and postfixes; their namespaces and usages entirely
disjunct.  Grammatical categories are very important to the 
extensibility

of the parser, so that's not something we're going to try to guess at.

On top of which, method names are off in the class's metaobject,
and don't participate in operator naming at all.  They have different
dispatchers: the operator is dispatched using the current set of nested
lexical scopes, while method calls are dispatched using the object's
set of parents and metaobjects.  This is how we keep OO from colliding
with functional programming.  You can make a method with any name you
like if you try hard enough, but that doesn't mean you can create 
random
associations with an operator or term throughout your program.  The 
scope
of the term you defined above will only be the lexical scope of the 
class
itself, and it won't get exported to the place you are wanting to use 
it,

even if you could use a term in postfix position, which you can't.

Sorry I can't write more clearly this early in the morning...  :)

Larry




Re: can a method name contain a funny character?

2016-04-12 Thread Larry Wall
On Mon, Apr 11, 2016 at 11:32:29PM +0200, 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 bunch of subs operators
: and methods.
: So I tried:
: 
: method term: { "Mel G.".say }
: 
: However, that gives me:
: 
: Bogus postfix

Because it *is* a bogus postfix.  Nobody defined a postfix, so to the
parser, there's just random unicode gobbledygook after the dot.  Defining
a term only adds to the list of things the grammar recognizes when a
*term* is expected.  A term is not expected right after another term.
That's where a postfix or an infix is expected.  A term is expected
only at the beginning of an expression, or after an infix.  You can't
mix together terms and postfixes; their namespaces and usages entirely
disjunct.  Grammatical categories are very important to the extensibility
of the parser, so that's not something we're going to try to guess at.

On top of which, method names are off in the class's metaobject,
and don't participate in operator naming at all.  They have different
dispatchers: the operator is dispatched using the current set of nested
lexical scopes, while method calls are dispatched using the object's
set of parents and metaobjects.  This is how we keep OO from colliding
with functional programming.  You can make a method with any name you
like if you try hard enough, but that doesn't mean you can create random
associations with an operator or term throughout your program.  The scope
of the term you defined above will only be the lexical scope of the class
itself, and it won't get exported to the place you are wanting to use it,
even if you could use a term in postfix position, which you can't.

Sorry I can't write more clearly this early in the morning...  :)

Larry


Re: can a method name contain a funny character?

2016-04-12 Thread Brock Wilcox
Heart doesn't work for me, but other symbols seem fine. I don't know why. I
also didn't need to quote them. Here is a REPL session from a
Rakudo 2016.01.1:

> sub Δ($x) { say "got $x" }
sub Δ ($x) { #`(Sub|106407520) ... }
> Δ(23)
got 23
> class Foo { method Δ($x) { say "method got $x" } }
> Foo.new.Δ(23)
method got 23


--Brock


On Tue, Apr 12, 2016 at 9:26 AM, Theo van den Heuvel 
wrote:

> @Parrot Raiser and @Luca. I will make sure to add Texan alternatives in
> case other people need to take over.
> I use triangle symbols to make internal symmetries in the code visible,
> and I have no problem pronouning or typing them.
> The code is substantially more readable with them. The same is true for
> the mathematical symbols provided by Perl6 itself.
> I can pick my own tools and I use tools that handle UNICODE well (e.g.
> Atom).
>
> Am I alone in running into 'Bogus postfix' error when I try to define a
> method like brave❤?
>
> Parrot Raiser schreef op 2016-04-12 14:50:
>
>> Mathematical symbols might be a legitimate case, since they are
>> generally pronounceable. Otherwise, special characters cause problems
>> both in entry from the keyboard and thinking about the code. (What
>> does it sound like if you describe it to yourself? foo.heart?)
>>
>> On 4/12/16, Luca Ferrari  wrote:
>>
>>> On Tue, Apr 12, 2016 at 9:44 AM, Theo van den Heuvel
>>>  wrote:
>>>

 ..
>
>
>>> unless you have to process the source code via some other tool that is
>>> unable to understand your symbols.
>>> I tend to refuse to code using more keys than those in my keyboard, my
>>> fault.
>>>
>>>
>>> Luca
>>>
>>>
>


Re: can a method name contain a funny character?

2016-04-12 Thread Theo van den Heuvel
@Parrot Raiser and @Luca. I will make sure to add Texan alternatives in 
case other people need to take over.
I use triangle symbols to make internal symmetries in the code visible, 
and I have no problem pronouning or typing them.
The code is substantially more readable with them. The same is true for 
the mathematical symbols provided by Perl6 itself.
I can pick my own tools and I use tools that handle UNICODE well (e.g. 
Atom).


Am I alone in running into 'Bogus postfix' error when I try to define a 
method like brave❤?


Parrot Raiser schreef op 2016-04-12 14:50:

Mathematical symbols might be a legitimate case, since they are
generally pronounceable. Otherwise, special characters cause problems
both in entry from the keyboard and thinking about the code. (What
does it sound like if you describe it to yourself? foo.heart?)

On 4/12/16, Luca Ferrari  wrote:

On Tue, Apr 12, 2016 at 9:44 AM, Theo van den Heuvel
 wrote:



..


unless you have to process the source code via some other tool that is
unable to understand your symbols.
I tend to refuse to code using more keys than those in my keyboard, my
fault.


Luca





Re: can a method name contain a funny character?

2016-04-12 Thread Parrot Raiser
Mathematical symbols might be a legitimate case, since they are
generally pronounceable. Otherwise, special characters cause problems
both in entry from the keyboard and thinking about the code. (What
does it sound like if you describe it to yourself? foo.heart?)

On 4/12/16, Luca Ferrari  wrote:
> On Tue, Apr 12, 2016 at 9:44 AM, Theo van den Heuvel
>  wrote:
>>
>> Why? Perhaps you are confusing taste and good sense. The heart is just an
>> example. My intention is for a mathematical symbol and a mathematical
>> meaning. I see nothing wrong with that.
>
> unless you have to process the source code via some other tool that is
> unable to understand your symbols.
> I tend to refuse to code using more keys than those in my keyboard, my
> fault.
>
>
> Luca
>


Re: can a method name contain a funny character?

2016-04-12 Thread Luca Ferrari
On Tue, Apr 12, 2016 at 9:44 AM, Theo van den Heuvel
 wrote:
>
> Why? Perhaps you are confusing taste and good sense. The heart is just an 
> example. My intention is for a mathematical symbol and a mathematical 
> meaning. I see nothing wrong with that.

unless you have to process the source code via some other tool that is
unable to understand your symbols.
I tend to refuse to code using more keys than those in my keyboard, my fault.


Luca


Re: can a method name contain a funny character?

2016-04-12 Thread Theo van den Heuvel
Why? Perhaps you are confusing taste and good sense. The heart is just 
an example. My intention is for a mathematical symbol and a mathematical 
meaning. I see nothing wrong with that.


Parrot Raiser schreef op 2016-04-12 01:06:

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 bunch of subs operators and
methods.
So I tried:

method term: { "Mel G.".say }

However, that gives me:

Bogus postfix

Thanks,
Theo

Larry Wall schreef op 2016-04-11 22:17:

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, not a method call, so you'd have to write
your postfix:<❤> operator to call the actual method in turn, with

sub postfix:<❤> ($f) { $f.'❤'() }

or so...

Larry

On Sun, Apr 10, 2016 at 03:23:21PM +0200, Theo van den Heuvel wrote:
: Hi perl6 fans,
:
: I can use funny characters in operators or in sub names (using
: term:<...>). However, when I try the same thing with an operator as
: in:
:
: 
: class Foo {
:   method term:<❤> { "mem heart".say }
: }
:
: my Foo $foo .= new;
: $foo.❤;
: 
:
: I get:
: Malformed postfix call
:
: That is unexpected for me, but is this as it should be?
:
: This is Rakudo version 2016.01.1 built on MoarVM version 2016.01
:
:
: Thanks,
:
:
:
:
: --
: Theo van den Heuvel
: Van den Heuvel HLT Consultancy





--
Theo van den Heuvel
Van den Heuvel HLT Consultancy
Malden, The Netherlands
 +31 24 3736356
 +31 625492788


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 bunch of subs operators and
> methods.
> So I tried:
>
> method term: { "Mel G.".say }
>
> However, that gives me:
>
> Bogus postfix
>
> Thanks,
> Theo
>
> Larry Wall schreef op 2016-04-11 22:17:
>> 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, not a method call, so you'd have to write
>> your postfix:<❤> operator to call the actual method in turn, with
>>
>> sub postfix:<❤> ($f) { $f.'❤'() }
>>
>> or so...
>>
>> Larry
>>
>> On Sun, Apr 10, 2016 at 03:23:21PM +0200, Theo van den Heuvel wrote:
>> : Hi perl6 fans,
>> :
>> : I can use funny characters in operators or in sub names (using
>> : term:<...>). However, when I try the same thing with an operator as
>> : in:
>> :
>> : 
>> : class Foo {
>> :   method term:<❤> { "mem heart".say }
>> : }
>> :
>> : my Foo $foo .= new;
>> : $foo.❤;
>> : 
>> :
>> : I get:
>> : Malformed postfix call
>> :
>> : That is unexpected for me, but is this as it should be?
>> :
>> : This is Rakudo version 2016.01.1 built on MoarVM version 2016.01
>> :
>> :
>> : Thanks,
>> :
>> :
>> :
>> :
>> : --
>> : Theo van den Heuvel
>> : Van den Heuvel HLT Consultancy
>
>


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,
Theo

Larry Wall schreef op 2016-04-11 22:17:

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, not a method call, so you'd have to write
your postfix:<❤> operator to call the actual method in turn, with

sub postfix:<❤> ($f) { $f.'❤'() }

or so...

Larry

On Sun, Apr 10, 2016 at 03:23:21PM +0200, Theo van den Heuvel wrote:
: Hi perl6 fans,
:
: I can use funny characters in operators or in sub names (using
: term:<...>). However, when I try the same thing with an operator as
: in:
:
: 
: class Foo {
:   method term:<❤> { "mem heart".say }
: }
:
: my Foo $foo .= new;
: $foo.❤;
: 
:
: I get:
: Malformed postfix call
:
: That is unexpected for me, but is this as it should be?
:
: This is Rakudo version 2016.01.1 built on MoarVM version 2016.01
:
:
: Thanks,
:
:
:
:
: --
: Theo van den Heuvel
: Van den Heuvel HLT Consultancy




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, not a method call, so you'd have to write
your postfix:<❤> operator to call the actual method in turn, with

sub postfix:<❤> ($f) { $f.'❤'() }

or so...

Larry

On Sun, Apr 10, 2016 at 03:23:21PM +0200, Theo van den Heuvel wrote:
: Hi perl6 fans,
: 
: I can use funny characters in operators or in sub names (using
: term:<...>). However, when I try the same thing with an operator as
: in:
: 
: 
: class Foo {
:   method term:<❤> { "mem heart".say }
: }
: 
: my Foo $foo .= new;
: $foo.❤;
: 
: 
: I get:
: Malformed postfix call
: 
: That is unexpected for me, but is this as it should be?
: 
: This is Rakudo version 2016.01.1 built on MoarVM version 2016.01
: 
: 
: Thanks,
: 
: 
: 
: 
: -- 
: Theo van den Heuvel
: Van den Heuvel HLT Consultancy


Re: can a method name contain a funny character?

2016-04-10 Thread Theo van den Heuvel

Hi Brock,

no, that gives me
Missing block

Theo

Brock Wilcox schreef op 2016-04-10 15:55:

Maybe try it without the term, just "method funnychar (..."
On Apr 10, 2016 09:23, "Theo van den Heuvel" 
wrote:


Hi perl6 fans,

I can use funny characters in operators or in sub names (using
term:<...>). However, when I try the same thing with an operator as
in:


class Foo {
  method term:<❤> { "mem heart".say }
}

my Foo $foo .= new;
$foo.❤;


I get:
Malformed postfix call

That is unexpected for me, but is this as it should be?

This is Rakudo version 2016.01.1 built on MoarVM version 2016.01

Thanks,

--
Theo van den Heuvel
Van den Heuvel HLT Consultancy


--
Theo van den Heuvel
Van den Heuvel HLT Consultancy
Malden, The Netherlands
 +31 24 3736356
 +31 625492788


Re: can a method name contain a funny character?

2016-04-10 Thread Brock Wilcox
Maybe try it without the term, just "method funnychar (..."
On Apr 10, 2016 09:23, "Theo van den Heuvel"  wrote:

> Hi perl6 fans,
>
> I can use funny characters in operators or in sub names (using
> term:<...>). However, when I try the same thing with an operator as in:
>
> 
> class Foo {
>   method term:<❤> { "mem heart".say }
> }
>
> my Foo $foo .= new;
> $foo.❤;
> 
>
> I get:
> Malformed postfix call
>
> That is unexpected for me, but is this as it should be?
>
> This is Rakudo version 2016.01.1 built on MoarVM version 2016.01
>
>
> Thanks,
>
>
>
>
> --
> Theo van den Heuvel
> Van den Heuvel HLT Consultancy
>
>