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

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

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

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

[perl6/specs] 33eaff: Update Supply introduction and method docs for ser...

2016-02-26 Thread GitHub
paths: M S17-concurrency.pod Log Message: --- Update Supply introduction and method docs for serial supplies Also some Channel clarifications. Commit: cc534c403199b0804fe05bd5cb88676142a878a1 https://github.com/perl6/specs/commit/cc534c403199b0804fe05bd5cb88676142

[perl6/specs] 627f2a: Fix - vs . method call typo in S17

2014-12-25 Thread GitHub
: M S17-concurrency.pod Log Message: --- Fix - vs . method call typo in S17

[perl6/specs] e15acb: Re-purpose the method ^foo(...) { ... } syntax.

2014-12-16 Thread GitHub
) Changed paths: M S12-objects.pod Log Message: --- Re-purpose the method ^foo(...) { ... } syntax. The existing design of it was out of line with the way Perl 6 evolved since then, and also not especially useful. This takes the syntax and enables its use for per-type meta-behavior

[perl6/specs] 8c901d: Refer to .content method for Pod blocks rather tha...

2014-07-16 Thread GitHub
: M S26-documentation.pod Log Message: --- Refer to .content method for Pod blocks rather than .contents

[perl6/specs] f143d1: Supply.(zip|merge) can be called as class method

2014-04-20 Thread GitHub
) Changed paths: M S17-concurrency.pod Log Message: --- Supply.(zip|merge) can be called as class method

[perl6/specs] 379579: [S05] Reintroduce the .ast method.

2014-03-13 Thread GitHub
: M S05-regex.pod Log Message: --- [S05] Reintroduce the .ast method. Every good language has a few synonyms anyway :) .

[perl6/specs] 24373d: Rename .ast method to .made

2014-02-04 Thread GitHub
) Changed paths: M S02-bits.pod M S05-regex.pod Log Message: --- Rename .ast method to .made This makes much more sense when paired with make. It also makes the generic examples of make that jnthn++ used in his http://jnthn.net/papers/2014-fosdem-perl6-today.pdf (slide #24

[perl6/specs] ae7cf3: Define .narrow method to narrow numeric types

2013-12-29 Thread GitHub
: M S32-setting-library/Numeric.pod Log Message: --- Define .narrow method to narrow numeric types Can narrow either Rat or Num to Int, for instance. Resolves #47.

[perl6/specs] 29e1f7: Change use of .elems on Set/Bag/Mix to new method ...

2013-10-05 Thread GitHub
) Changed paths: M S32-setting-library/Containers.pod Log Message: --- Change use of .elems on Set/Bag/Mix to new method .total

[perl6/specs] 41296c: [S12]: bless is a method, not a function

2013-08-26 Thread GitHub
paths: M S12-objects.pod Log Message: --- [S12]: bless is a method, not a function

[perl6/specs] 0cca60: round method produces a Real, not always Int

2013-06-24 Thread GitHub
paths: M S32-setting-library/Numeric.pod Log Message: --- round method produces a Real, not always Int provided a better description of what the specced algorithm actually does

[perl6/specs] b49be3: Remove mention of .exists method from example, rep...

2013-06-22 Thread GitHub
) Changed paths: M S11-modules.pod Log Message: --- Remove mention of .exists method from example, replace by :exists adverb

[perl6/specs] 01c9f4: Added some identical method based examples, seemed...

2013-06-16 Thread GitHub
) Changed paths: M S32-setting-library/Containers.pod Log Message: --- Added some identical method based examples, seemed appropriate

[perl6/specs] 5faf89: [S02] Small clarification about method .tree

2013-06-11 Thread GitHub
: M S02-bits.pod Log Message: --- [S02] Small clarification about method .tree Make it clear that the phrase level-sensitive map refers to the specific Cmap function/method, as opposed to some general concept of a map.

[perl6/specs] 18c244: Replace mention of now defunct .file method by de-...

2013-04-12 Thread GitHub
) Changed paths: M S03-operators.pod Log Message: --- Replace mention of now defunct .file method by de-facto .path

[perl6/specs] b1c338: add combinations method

2013-02-16 Thread GitHub
: M S32-setting-library/Containers.pod Log Message: --- add combinations method

Re: The .trans method and Least Surprise

2012-07-20 Thread Carl Mäsak
yary (): Speaking as a non-p6-coder proposal sounds good to me though the spec raises some other questions. The tr/// quote-like operator now also has a method form called trans(). Its argument is a list of pairs. You can use anything that produces a pair list: $str.trans

The .trans method and Least Surprise

2012-07-13 Thread Carl Mäsak
Something's bothering me about the .trans method. This email lists a proposal to split its semantics into two methods. I'm not yet convinced myself about this proposal. It's quite late in the game to make spec changes of established methods, and the change will break some downstream application

Re: The .trans method and Least Surprise

2012-07-13 Thread yary
Speaking as a non-p6-coder proposal sounds good to me though the spec raises some other questions. The tr/// quote-like operator now also has a method form called trans(). Its argument is a list of pairs. You can use anything that produces a pair list: $str.trans( %mapping.pairs ); Does

[perl6/specs] 578e3c: [S04] un-spec method-level PRE/POST

2012-03-11 Thread GitHub
paths: M S04-control.pod Log Message: --- [S04] un-spec method-level PRE/POST The intent was to extend block-level PRE/POST to something that could do Eiffel-style Design-by-Contract assertions. This is an intriguing idea, but not in the way the spec outlined it. See http

[perl6/specs] 315449: spec method form of make

2012-02-03 Thread GitHub
paths: M S05-regex.pod Log Message: --- spec method form of make the sub form just looks up whatever $/ it finds, which makes it unnecessary hard to work with multiple match objects at once, for example when doing regex matches in action methods

[perl6/specs] 8a9969: [S06] avoid indirect method call syntax

2011-12-27 Thread noreply
paths: M S06-routines.pod Log Message: --- [S06] avoid indirect method call syntax It is unrelated to the topic, and seem to confuse readers. Me too.

[perl6/specs] e1c674: Add conjugate method (for RT 76602)

2011-03-02 Thread noreply
-setting-library/Numeric.pod Log Message: --- Add conjugate method (for RT 76602)

Method 'Bool' not found for invocant of class 'Integer'

2011-01-04 Thread Nathaniel
, but I've tried copying everything over and I can't seem to find what is present in the rakudo directory but not in the one for my executable. Is there some c method I can call to point a parrot interpreter at a particular runtime directory -- like the same one as rakudo/perl6 itself uses?

[perl6/specs] 61e2e1: copy-paste issues with new roll method

2010-09-16 Thread noreply
-library/Containers.pod Log Message: --- copy-paste issues with new roll method jkpeters_37++ points out a problem in the new specs for .roll, which are now revised for (I hope) more clarity.

Re: Breaking encapsulation by detaching a private-variable-accessing method from one object and calling it on another

2010-08-03 Thread Michael Zedeler
On 2010-07-31 20:23, Carl Mäsak wrote: * Today we discovered that it's possible to break encapsulation by detaching a method from an object of one class, and calling that method on an object of another class. Which means that breaking the encapsulation of a foreign class is as easy as creating

Re: Breaking encapsulation by detaching a private-variable-accessing method from one object and calling it on another

2010-08-03 Thread Carl Mäsak
jnthn++ points out in meatspace that the invocant parameter has a constraint (by spec but not in Rakudo), which will carry over to the new class. Which means that only objects of child classes will signature-bind anyway. // Carl

Re: Breaking encapsulation by detaching a private-variable-accessing method from one object and calling it on another

2010-08-02 Thread Moritz Lenz
techniques (which aren't fully specced yet, but they *will* exist. In case of doubt you can just parse .perl output). * If it isn't allowed, which of the two steps is disallowed? *Detaching* a method containing references to private accessor slots (thereby extending the syntactic restriction

Re: Breaking encapsulation by detaching a private-variable-accessing method from one object and calling it on another

2010-08-02 Thread Carl Mäsak
Carl (), Moritz (): * If it isn't allowed, which of the two steps is disallowed? *Detaching* a method containing references to private accessor slots (thereby extending the syntactic restriction of no private accessors outside of the class block), or *attaching* an anonymous method

rounding method adverbs

2010-08-01 Thread Darren Duncan
mandatory config arguments for users to explicitly state the semantics they want, but that once again a lexical pragma can declare this at a higher level. Specifically, I think there should be a configuration for any numeric operations that might do rounding, where users specify the rounding method

Breaking encapsulation by detaching a private-variable-accessing method from one object and calling it on another

2010-07-31 Thread Carl Mäsak
that attribute slots of the type $!foo are only allowed *syntactically* within the class block that declares them. (The exception to this, I guess, is the 'trusts' directive.) But this means that something like this anonymous method my $reveal-foo = method { say $!foo } isn't allowed. I think that's

Re: Breaking encapsulation by detaching a private-variable-accessing method from one object and calling it on another

2010-07-31 Thread Brandon S Allbery KF8NH
by no means an OO expert. It would be interesting to hear your views on this. The whole concept of detaching and attaching methods seems suspect to me; in particular, attaching a method from a class not declared to be related reeks of monkey patching. As such, I'd only allow it when monkey patching

Re: Breaking encapsulation by detaching a private-variable-accessing method from one object and calling it on another

2010-07-31 Thread Stefan O'Rear
this anonymous method my $reveal-foo = method { say $!foo } isn't allowed. I think that's good, because it would provide a very easy way to break encapsulation of an object; just call $object.$reveal-foo() on it. There is no $!foo. There is only $!Class::foo, and $!foo is a lexically

Re: Breaking encapsulation by detaching a private-variable-accessing method from one object and calling it on another

2010-07-31 Thread Stefan O'Rear
like either option. I'm by no means an OO expert. It would be interesting to hear your views on this. The whole concept of detaching and attaching methods seems suspect to me; in particular, attaching a method from a class not declared to be related reeks of monkey patching. As such, I'd

Re: Breaking encapsulation by detaching a private-variable-accessing method from one object and calling it on another

2010-07-31 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 7/31/10 14:38 , Stefan O'Rear wrote: On Sat, Jul 31, 2010 at 02:36:02PM -0400, Brandon S Allbery KF8NH wrote: The whole concept of detaching and attaching methods seems suspect to me; in particular, attaching a method from a class not declared

Re: Breaking encapsulation by detaching a private-variable-accessing method from one object and calling it on another

2010-07-31 Thread Carl Mäsak
Carl (), sorear (): * It has been decided that attribute slots of the type $!foo are only allowed *syntactically* within the class block that declares them. (The exception to this, I guess, is the 'trusts' directive.) But this means that something like this anonymous method     my $reveal

Mixing in to method objects

2009-06-25 Thread Matthew Walton
As I understand it, in Perl 6 a method of a class, as indeed all similar things like a sub or a regex, is represented by an object. If it's an object, I should be able to mix a role into it, right? Something like: role Fancy { has $.something is rw; } sub a { } a does Fancy; a.something = 56

Re: [perl #62528] Match.keys method returns nothing.

2009-03-29 Thread Moritz Lenz
Since afaict this is not specced, I'll hand that over to p6l. Eric Hodges (via RT) wrote: use v6; rule test {test}; test ~~ /test/; say '$/.keys = ', $/.keys.perl; say '%($/).keys = ', %($/).keys.perl; # outputs # $/.keys = [] # %($/).keys = [test] Same could be said for .values

Re: [perl #62528] Match.keys method returns nothing.

2009-03-29 Thread Jon Lang
Moritz Lenz wrote: Since afaict this is not specced, I'll hand that over to p6l. Eric Hodges (via RT) wrote: use v6; rule test {test}; test ~~ /test/; say '$/.keys = ', $/.keys.perl; say '%($/).keys = ', %($/).keys.perl; # outputs # $/.keys = [] # %($/).keys = [test] Same could be

Re: [PATCH] Add .trim method

2009-01-13 Thread Brandon S. Allbery KF8NH
On 2009 Jan 12, at 15:17, Ovid wrote: בָּרוּךְ שֵׁם כְּבוֹד מַלְכוּתוֹ לְעוֹלָם וָעֶד. If you can't see that in your client, that's Hebrew from http://www.i18nguy.com/unicode/shma.html and means Hear O Israel, the Lord is our God, the Lord is One. Actually that's the

Re: [PATCH] Add .trim method

2009-01-12 Thread Ovid
- Original Message From: Ovid publiustemp-perl6interna...@yahoo.com This patch implements the .trim() method for strings. Now that I'm reading S29, I see there is no .trim() method there. I got that because it was referenced in pugs in the cookbook (not in tests, though

Re: [PATCH] Add .trim method

2009-01-12 Thread Carl Mäsak
Ovid (): =item trim our Str multi Str::trim ( Str $string ) Removes leading and trailing whitespace from a string. =cut I could optionally make the following work: $string.trim(:leading0); $string.trim(:trailing0); Setting leading or trailing to false (they default to true)

Re: [PATCH] Add .trim method

2009-01-12 Thread Ovid
- Original Message =item trim our Str multi Str::trim ( Str $string ) Removes leading and trailing whitespace from a string. =cut I could optionally make the following work: $string.trim(:leading0); $string.trim(:trailing0); Setting leading or

Re: [PATCH] Add .trim method

2009-01-12 Thread Ovid
- Original Message I could optionally make the following work: $string.trim(:leading0); $string.trim(:trailing0); Alternatively, those could be ltrim() and rtrim(). If you need to dynamically determine what you're going to trim, you'd couldn't just set variables to do

Re: [PATCH] Add .trim method

2009-01-12 Thread Aristotle Pagaltzis
* Ovid publiustemp-perl6langua...@yahoo.com [2009-01-12 16:05]: Or all could be allowed and $string.trim(:leading0) could all $string.rtrim internally. ++ Regards, -- Aristotle Pagaltzis // http://plasmasturm.org/

Re: [PATCH] Add .trim method

2009-01-12 Thread Jonathan Worthington
Aristotle Pagaltzis wrote: * Ovid publiustemp-perl6langua...@yahoo.com [2009-01-12 16:05]: Or all could be allowed and $string.trim(:leading0) could all $string.rtrim internally. ++ Note you can write it :!leading too. :-) Jonathan

Re: [PATCH] Add .trim method

2009-01-12 Thread Larry Wall
On Mon, Jan 12, 2009 at 05:04:50AM -0800, Ovid wrote: : ...the trivial $string.trim and trim($string) case. Hmm, I'd think .trim should work like .chomp, and return the trimmed string without changing the original. You'd use $str.=trim to do it in place. Can't say I really like the negated

Re: [PATCH] Add .trim method

2009-01-12 Thread Jonathan Worthington
Ovid wrote: - Original Message In the pir, doesn't the s = self line copy self, thus ensuring that I'm changing s and not self? No, it's binding. Or do I need s = clone self (or however it's written). Yeah, but also note that substr would return a copy... Can't say I

Re: [PATCH] Add .trim method

2009-01-12 Thread Carl Mäsak
Jonathan (), Ovid (), Larry (): Can't say I really like the negated options though. They smell funny. Agreed, but ltrim and rtrim will disappoint Israelis and dyslexics alike. Suggestions welcome as I can't think of anything better. The .Net framework calls 'em TrimStart and TrimEnd (and

Re: [PATCH] Add .trim method

2009-01-12 Thread Geoffrey Broadwell
On Mon, 2009-01-12 at 07:01 -0800, Ovid wrote: - Original Message I could optionally make the following work: $string.trim(:leading0); $string.trim(:trailing0); Alternatively, those could be ltrim() and rtrim(). If you need to dynamically determine what you're

Re: [PATCH] Add .trim method

2009-01-12 Thread Ovid
- Original Message Agreed, but ltrim and rtrim will disappoint Israelis and dyslexics alike. Suggestions welcome as I can't think of anything better. The .Net framework calls 'em TrimStart and TrimEnd (and has a Trim that does both). So maybe trim_start and trim_end if we

Re: [PATCH] Add .trim method

2009-01-12 Thread Ovid
- Original Message From: Geoffrey Broadwell ge...@broadwell.org When I saw your proposed syntax above, instead of reading don't trim leading/trailing whitespace, I read change the definition of 'whitespace' to 'codepoint 0' for leading/trailing. That of course raises the question

Re: [PATCH] Add .trim method

2009-01-12 Thread Larry Wall
On Mon, Jan 12, 2009 at 09:33:32AM -0800, Geoffrey Broadwell wrote: : That of course raises the question of how one *would* properly override : trim's concept of whitespace Well, given that .trim is essentially just .comb(/\S.*\S/), which in turn is really just m:g/(\S.*\S)/, I don't see

Re: [PATCH] Add .trim method

2009-01-12 Thread Andy Colson
the regex method of trimming? -Andy

Re: [PATCH] Add .trim method

2009-01-12 Thread Aristotle Pagaltzis
* Ovid publiustemp-perl6langua...@yahoo.com [2009-01-12 18:40]: 1. No params, trim all 2. :start or :end, only trim that bit (not a negated option :) 3. If both, goto 1 Also `:!start` to imply `:end` unless `:!end` (which in turn implies `:start` unless `:!end`)? I’d like not to have to

Re: [PATCH] Add .trim method

2009-01-12 Thread Mark J. Reed
On Mon, Jan 12, 2009 at 2:50 PM, Aristotle Pagaltzis pagalt...@gmx.de wrote: I'd like not to have to type `.trim(:start)` when I could just do `.ltrim` though. As long as we gloss .ltrim as leading trim rather than left trim. Then the other end could be .ttrim for trailing? We really ought to

Re: [PATCH] Add .trim method

2009-01-12 Thread Ovid
- Original Message Also `:!start` to imply `:end` unless `:!end` (which in turn implies `:start` unless `:!end`)? I’d like not to have to type `.trim(:start)` when I could just do `.ltrim` though. So what would .ltrim do with this? בָּרוּךְ שֵׁם כְּבוֹד מַלְכוּתוֹ לְעוֹלָם

Re: [PATCH] Add .trim method

2009-01-12 Thread Aristotle Pagaltzis
* Aristotle Pagaltzis pagalt...@gmx.de [2009-01-12 20:55]: Also `:!start` to imply `:end` unless `:!end` (which in turn implies `:start` unless `:!end`)? Ugh, forget this, I was having a blank moment. Actually that makes me wonder now whether it’s actually a good idea at all to make the

Re: [PATCH] Add .trim method

2009-01-12 Thread Aristotle Pagaltzis
* Ovid publiustemp-perl6langua...@yahoo.com [2009-01-12 21:20]: Since that's RTL (Right To Left) text, should ltrim remove the leading or trailing whitespace? I like Jonathan's trim_start and trim_end. Let me ask you first: does a string that runs Right-to-Left start at the left and end at

Re: [PATCH] Add .trim method

2009-01-12 Thread Larry Wall
On Mon, Jan 12, 2009 at 09:18:03PM +0100, Aristotle Pagaltzis wrote: : Plus if there are separate `.ltrim` and `.rtrim` functions it : would be better to implement `.trim` by calling them rather than : vice versa, so it wouldn’t even be less efficient two make two : calls rather than a

Re: [PATCH] Add .trim method

2009-01-12 Thread Austin Hastings
Aristotle Pagaltzis wrote: Actually that makes me wonder now whether it’s actually a good idea at all to make the function parametrisable at all. Even `.ltrim.rtrim` is shorter and easier than `.trim(:start,:end)`! How about .trim(:l, :r) with both as the default? And if the rtl crowd

Re: [PATCH] Add .trim method

2009-01-12 Thread Ovid
, *I* know where the *left* side is in a string that runs from right to left: it’s at the *left*, same as if the string ran from the left to the right, because left is at the *left*. :-) I see your point, but it complicates the internals of the trim method because then I have to detect

Re: [PATCH] Add .trim method

2009-01-12 Thread Aristotle Pagaltzis
* Larry Wall la...@wall.org [2009-01-12 21:55]: * Aristotle Pagaltzis pagalt...@gmx.de [2009-01-12 21:20]: Plus if there are separate `.ltrim` and `.rtrim` functions it would be better to implement `.trim` by calling them rather than vice versa, so it wouldn’t even be less efficient two

Re: [PATCH] Add .trim method

2009-01-12 Thread Aristotle Pagaltzis
* Ovid publiustemp-perl6langua...@yahoo.com [2009-01-12 22:05]: I see your point And now I see yours. I was visualising the memory layout of a string, wherein a right-to-left string gets displayed from the right end of it’s in-memory representation so “left” and “right” are absolutes in that

Re: [PATCH] Add .trim method

2009-01-12 Thread Aristotle Pagaltzis
* Austin Hastings austin_hasti...@yahoo.com [2009-01-12 22:00]: How about .trim(:l, :r) with both as the default? Liveable. And if the rtl crowd makes a furor, we can add :a/:o or :ת/:א or something. *grin* Maybe :h and :t (head/tail). Useful for doing infrequent things. IMO, left and

Re: [PATCH] Add .trim method

2009-01-12 Thread Ovid
- Original Message From: Aristotle Pagaltzis pagalt...@gmx.de * Austin Hastings [2009-01-12 22:00]: How about .trim(:l, :r) with both as the default? Liveable. I've just committed the pugs tests for trim. However, it's just 'trim' with no left/right, leading/trailing,

Re: [PATCH] Add .trim method

2009-01-12 Thread Ovid
- Original Message From: jesse je...@fsck.com On Mon, Jan 12, 2009 at 07:01:25AM -0800, Ovid wrote: I could optionally make the following work: $string.trim(:leading0); $string.trim(:trailing0); Alternatively, those could be ltrim() and rtrim(). 'left'

Re: [PATCH] Add .trim method

2009-01-12 Thread Gianni Ceccarelli
On 2009-01-12 Ovid publiustemp-perl6interna...@yahoo.com wrote: Um, er. Damn. Now I'm wondering how my leading and trailing trimming works with Hebrew. How are the strings implemented internally? RTL (and bidi) languages are written in strings so that the character order is the logical,

Re: [PATCH] Add .trim method

2009-01-12 Thread Jonathan Scott Duff
On Mon, Jan 12, 2009 at 9:01 AM, Ovid publiustemp-perl6langua...@yahoo.comwrote: - Original Message I could optionally make the following work: $string.trim(:leading0); $string.trim(:trailing0); Alternatively, those could be ltrim() and rtrim(). If you need to

Re: [PATCH] Add .trim method

2009-01-12 Thread Ovid
- Original Message From: Larry Wall la...@wall.org On Mon, Jan 12, 2009 at 05:04:50AM -0800, Ovid wrote: : ...the trivial $string.trim and trim($string) case. Hmm, I'd think .trim should work like .chomp, and return the trimmed string without changing the original. You'd use

Re: [PATCH] Add .trim method

2009-01-12 Thread Dave Whipp
Ovid wrote: $string.trim(:leading0); $string.trim(:trailing0); Setting leading or trailing to false (they default to true) would result in either leading or trailing whitespace not being trimmed Alternatively, those could be ltrim() and rtrim(). If you need to dynamically determine

Re: [PATCH] Add .trim method

2009-01-12 Thread jesse
On Mon, Jan 12, 2009 at 07:01:25AM -0800, Ovid wrote: I could optionally make the following work: $string.trim(:leading0); $string.trim(:trailing0); Alternatively, those could be ltrim() and rtrim(). 'left' and 'right' are probably not the right names for functions which

Re: [PATCH] Add .trim method

2009-01-12 Thread Andy Lester
On Jan 12, 2009, at 11:27 AM, Carl Mäsak wrote: How about .trim(:start) and .trim(:end)? And .trim(:both) for orthogonality. -- Andy Lester = a...@petdance.com = www.petdance.com = AIM:petdance

Re: [PATCH] Add .trim method

2009-01-12 Thread Moritz Lenz
and TrimEnd (and has a Trim that does both). So maybe trim_start and trim_end if we wanted to take that lead... How about .trim(:start) and .trim(:end)? That would be my favourite: our Str multi method trim (Str $string:, :start = True, :end = True) So $str.=trim would trim both start

Re: [PATCH] Add .trim method

2009-01-12 Thread Larry Wall
can't think of anything better. : : The .Net framework calls 'em TrimStart and TrimEnd (and has a Trim that does : both). So maybe trim_start and trim_end if we wanted to take that lead... : : How about .trim(:start) and .trim(:end)? : : That would be my favourite: : : our Str multi method

Re: [PATCH] Add .trim method

2009-01-12 Thread jason switzer
On Mon, Jan 12, 2009 at 9:07 AM, jesse je...@fsck.com wrote: 'left' and 'right' are probably not the right names for functions which trim leading and/or trailing space, since their meanings get somewhat ambiguous if a language renders right-to-left instead of left-to-right or vice-versa

Trimming; left or start? (was: Re: [PATCH] Add .trim method)

2009-01-12 Thread Timothy S. Nelson
Can I make a suggestion? From my point of view, it'd be nice if the trim method supported: - left/right (leftmost/rightmost part of the string; language-independent) - start/end (start and end of string; could be leading/trailing instead) - both How would that work

Re: [PATCH] Add .trim method

2009-01-12 Thread Ovid
- Original Message From: jason switzer jswit...@gmail.com If we wanted language dependent version, use :leading, :trailing, and :both. That will require each implementation properly handle the language variations. I think :start and :end are my favorites. Huffman++ (maybe :begin

Re: [PATCH] Add .trim method

2009-01-12 Thread jason switzer
On Mon, Jan 12, 2009 at 6:26 PM, Ovid publiustemp-perl6langua...@yahoo.comwrote: - Original Message From: jason switzer jswit...@gmail.com If we wanted language dependent version, use :leading, :trailing, and :both. That will require each implementation properly handle the

new method question

2008-08-22 Thread Xiao Yafeng
There are no barewords in Perl 6, but it seems new method is an exception: class Dog { has $name; method bark () { say $name; } } my $p = Dog.new($name = 'boo'); $p.bark;#error! my $p = Dog.new( name = 'boo

Re: new method question

2008-08-22 Thread John M. Dlugosz
Moritz Lenz moritz-at-casella.verplant.org |Perl 6| wrote: Attributes need to have a twigil, so it would be has $.name The syntax has $name; with no twigil is legal according to S12. Perhaps the original poster (Xiao Yafeng) might like to read

Re: syntax question: method close is export ()

2008-08-06 Thread Larry Wall
On Tue, Aug 05, 2008 at 05:43:57PM +0800, Audrey Tang wrote: John M. Dlugosz 提到: Does that mean that traits can come before the signature? Or should it be corrected to method close () is export { ... } It's a simple typo. Thanks, fixed in r14572. The strange thing is that we might

Re: syntax question: method close is export ()

2008-08-05 Thread Audrey Tang
John M. Dlugosz 提到: Does that mean that traits can come before the signature? Or should it be corrected to method close () is export { ... } It's a simple typo. Thanks, fixed in r14572. Cheers, Audrey

syntax question: method close is export ()

2008-08-05 Thread John M. Dlugosz
Does that mean that traits can come before the signature? Or should it be corrected to method close () is export { ... } ?

Re: method hiding (or not) in derived classes

2008-04-21 Thread TSa
are for. And even if a candidate is voted out it still can vote out others. What about ordinary methods (and ordinary parameters of multis)? Does the candidate list hold every method name that matches, or does it do simpler parameter matching based on number of arguments, required named arguments

Re: method hiding (or not) in derived classes

2008-04-21 Thread John M. Dlugosz
, there is a list. What about ordinary methods (and ordinary parameters of multis)? Does the candidate list hold every method name that matches, or does it do simpler parameter matching based on number of arguments, required named arguments, etc.? There is hopefully a complete specification what

Re: method hiding (or not) in derived classes

2008-04-21 Thread Larry Wall
parameters, compare the actual type and drop out of the list if any don't match. When you drop those candidates that can never match is mostly a matter of optimization, I suspect. : What about ordinary methods (and ordinary parameters of multis)? Does the candidate list hold every method name

Re: method hiding (or not) in derived classes

2008-04-21 Thread TSa
not be a unique next method on the target list and a nextsame might fail. I agree that the synopsis conflate these details into the term candidate list. But I hope you are more rigorous. What about ordinary methods (and ordinary parameters of multis)? Does the candidate list hold every method

method hiding (or not) in derived classes

2008-04-19 Thread John M. Dlugosz
don't match. What about ordinary methods (and ordinary parameters of multis)? Does the candidate list hold every method name that matches, or does it do simpler parameter matching based on number of arguments, required named arguments, etc.? If that is the case, then a derived method might not hide

Re: multi method dispatching of optional arguments (further refined)

2006-09-11 Thread Larry Wall
On Mon, Sep 04, 2006 at 10:52:35PM -0700, Trey Harris wrote: : In a message dated Tue, 5 Sep 2006, Ph. Marek writes: : I now had a look at http://dev.perl.org/perl6/doc/design/syn/S06.html : but didn't find what I meant. Sorry if I'm just dumb and don't : understand you (or S06); I'll try to

Re: but semantics (was Re: Naming the method form of s///)

2006-09-11 Thread Larry Wall
On Mon, Sep 04, 2006 at 08:54:02PM +0200, TSa wrote: : But are assignment ops allowed as initializer? : : my $z = $p but= { .y = 17 }; Why not? It's only the first = that's potentially special. (And it's only for non-my, since my's = is an ordinary assignment at normal run time.) I don't

Re: but semantics (was Re: Naming the method form of s///)

2006-09-11 Thread Larry Wall
On Mon, Sep 11, 2006 at 11:12:00AM -0700, Larry Wall wrote: : On Mon, Sep 04, 2006 at 08:54:02PM +0200, TSa wrote: : : But are assignment ops allowed as initializer? : : : : my $z = $p but= { .y = 17 }; : : Why not? It's only the first = that's potentially special. (And it's : only for

Re: multi method dispatching of optional arguments (further refined)

2006-09-05 Thread Ph. Marek
On Tuesday 05 September 2006 07:52, Trey Harris wrote: I don't think you're dumb; the Synopses just require that you intuit certain things from each other, from examples in other Synopses, and so on in a Perlish sort of way; what you're looking for is not spelled out explicitly. It can be

Re: multi method dispatching of optional arguments (further refined)

2006-09-05 Thread Ruud H.G. van Tol
Ph. Marek schreef: [Haskell] SomeThing a b | a = 4 : b+2 | b = 3 : a+1 | otherwise : a*b In Perl5 this looks like sub SomeThing { my($a, $b)[EMAIL PROTECTED]; return b+2 if ($a == 4); return a+1 if ($b == 3); return a*b; } Or like: sub SomeThing { alias my

Re: multi method dispatching of optional arguments (further refined)

2006-09-04 Thread Audrey Tang
2006/9/4, Ph. Marek [EMAIL PROTECTED]: On Sunday 03 September 2006 14:25, Mark Stosberg wrote: Luke Palmer wrote: On 9/3/06, Mark Stosberg [EMAIL PROTECTED] wrote: Note that the variant /with/ the parameter can be considered an exact match, but but the variant /without/ it cannot be

Re: but semantics (was Re: Naming the method form of s///)

2006-09-04 Thread TSa
HaloO, Trey Harris wrote: I do not think that Cbut should mutate its LHS, regardless what its RHS is. I strongly agree. We have the mutating version $p but= { .y = 17 }; which is just one char longer and nicely blends as a meta operator. But are assignment ops allowed as initializer?

  1   2   3   4   5   6   >