Re: CALL-ME vs. Callable

2016-11-14 Thread Jon Lang
to be a distinct role. Which is part of why I brought this up: the current > doc does not match what currently happens, and may not actually be > implementable without breaking the spec (that is, 6.d would have a > fundamental conflict with 6.c over the meaning of Callable). > > On M

Re: Anonymous multi-subs

2015-06-24 Thread Jon Lang
On Wednesday, June 24, 2015, yary not@gmail.com wrote: Now that I've thought about it for 90 seconds (not fully-formed idea), if one were to have an anonymous multi-sub, it ought to be constructed from a list of *signature*, *body *pairs. And/or, any non-finalized sub could have a method

Re: How to make a new operator.

2012-03-22 Thread Jon Lang
On Thu, Mar 22, 2012 at 9:07 AM, Bruce Gray bruce.g...@acm.org wrote: On Mar 21, 2012, at 11:49 PM, Jonathan Lang wrote: What I want to know is whether there's a way to define a step function that's based in part or in whole on the current term's index. For example, how would I use

dimensionality in Perl 6

2010-11-18 Thread Jon Lang
Here's my proposal for how to handle dimensionality in Perl 6: Create a units trait that is designed to attach to any Numeric object. Dimensional information gets stored as a baggy object - that is, something that works just like a Bag, except that the count can go negative. (I don't know if

Re: dimensionality in Perl 6

2010-11-18 Thread Jon Lang
On Thu, Nov 18, 2010 at 8:25 PM, Carl Mäsak cma...@gmail.com wrote: Jon (): Here's my proposal for how to handle dimensionality in Perl 6: [...] Thoughts? The idea has come up before, everyone thinks that Perl 6 and unit handling are a good fit for each other, and we're basically waiting

Re: dimensionality in Perl 6

2010-11-18 Thread Jon Lang
Buddha Buck wrote: Jon Lang wrote: Here's my proposal for how to handle dimensionality in Perl 6: Create a units trait that is designed to attach to any Numeric object.  Dimensional information gets stored as a baggy object - that is, something that  works just like a Bag, except

Re: exponentiation of Duration's

2010-11-17 Thread Jon Lang
If I'm following this correctly, shouldn't we just say that Duration does Num? That way, a Duration can be used exactly like a Num is (with units measured in seconds); but it could also have special capabilities above and beyond what a Num can do, if such capabilities are needed. More generally,

Re: exponentiation of Duration's

2010-11-17 Thread Jon Lang
Moritz Lenz wrote: Am 17.11.2010 17:50, schrieb Jon Lang: More generally, I wonder if maybe we _should_ provide a tool to help I think this question can only be answered in a meaningful way if somebody actually implements such a thing as a module (which should be entirely possible in Rakudo

Re: Packed arrays and assignment vs binding

2010-11-14 Thread Jon Lang
On Sun, Nov 14, 2010 at 2:54 AM, Moritz Lenz mor...@faui2k3.org wrote: On IRC, Jonathan said that 1 is basically an Int, which is something like a boxed int. So whatever operation works removes the box, and puts the result in the variable. However I wonder how well that's going to work, since

Re: Packed arrays and assignment vs binding

2010-11-13 Thread Jon Lang
Jonathan Worthington wrote: In the latter case, it's fairly clear how these differ: @x[0] = 1; @x[0] := 1; In the first, we look up the container in slot 0 or the array and assign a 1 into it. In the second, we bind a 1 directly into the slot. There's no container any more (so any future

Re: Bag / Set ideas - making them substitutable for Arrays makes them more useful

2010-11-13 Thread Jon Lang
Brandon S Allbery KF8NH wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/7/10 23:19 , Jon Lang wrote:     1 -- 2 -- 3 Would be a Bag containing three elements: 1, 2, and 3. Personally, I wouldn't put a high priority on this; for my purposes,    Bag(1, 2, 3) works just fine

Re: Bag / Set ideas - making them substitutable for Arrays makes them more useful

2010-11-13 Thread Jon Lang
Carl Mäsak wrote: Jonathan Lang (): That saves a singlr character over Bag( ... ) and Set( ... ), respectively (or three characters, if you find decent unicode bracket choices).  It still wouldn't be a big enough deal to me to bother with it. +1. Let's leave it at that. That said, I do

Re: Bag / Set ideas - making them substitutable for Arrays makes them more useful

2010-11-13 Thread Jon Lang
Darren Duncan wrote: Jon Lang wrote: That saves a singlr character over Bag( ... ) and Set( ... ), respectively (or three characters, if you find decent unicode bracket choices).  It still wouldn't be a big enough deal to me to bother with it. As well, my first impression upon seeing

Re: Bag / Set ideas - making them substitutable for Arrays makes them more useful

2010-11-08 Thread Jon Lang
Solomon Foster wrote: Well, hyperoperators work fine on Hashes, they operate on the values, paired up by key if needed.  (That is, %hash++ doesn't care about the keys, %hash1 + %hash2 sums based on keys.)  I would assume that Bag should work in the exact same way.  Dunno how Set should work

Re: Bag / Set ideas - making them substitutable for Arrays makes them more useful

2010-11-08 Thread Jon Lang
This is going to be a rambling answer, as I have a number of questions but no firm conclusions. Please bear with me. Mason Kramer wrote: Having Bags flatten in list context is pretty crucial to their being as easy and terse to use as arrays, because flattening is fundamental to how Arrays are

Re: Bag / Set ideas - making them substitutable for Arrays makes them more useful

2010-11-07 Thread Jon Lang
Mason Kramer wrote: I'd like to anticipate one objection to this - the existence of the 'hyper' operator/keyword.  The hyper operator says, I am taking responsibility for this particular code block and promising that it can execute out of order and concurrently.  Creating a Bag instead of

Re: Lists vs sets

2010-10-25 Thread Jon Lang
yary wrote: +1 on this On Mon, Oct 25, 2010 at 4:56 PM, Jon Lang datawea...@gmail.com wrote: As for the bit about sets vs. lists: personally, I'd prefer that there not be quite as much difference between them as there currently is. That is, I'd rather sets be usable wherever lists are called

Re: Lists vs sets

2010-10-25 Thread Jon Lang
Mason Kramer wrote: But I don't think that thinking about who is subclassing whom is is how to think about this in Perl 6.  All of these types are capable of doing the Iterable role, and that is what methods that could operate on a List, Array, Bag, or Set, should be calling for. This.  

Re: Lists vs sets

2010-10-25 Thread Jon Lang
Darren Duncan wrote: If a list is a set, does that mean that a list only contains/returns each element once when iterated?  If a list can have duplicates, then a list isn't a set, I would think. -- Darren Duncan Thus Mason's point about Bags. Really, I think that Mason's right in that we

Re: threads?

2010-10-12 Thread Jon Lang
When Larry decided that Perl 6 would incorporate concepts from prototype-based objects, he did so at least in part because it's more intuitive for people to work with, e.g., a cow than it is to try to work with the concept of a cow as a thing unto itself. In a similar way, I think that Perl's

Re: r31972 -[S05] specify what .keys, .values and .kv do on Match objects

2010-08-12 Thread Jon Lang
How does a Match compare to a Parcel? -- Jonathan Dataweaver Lang

Re: pattern alternation (was Re: How are ...)

2010-08-05 Thread Jon Lang
Aaron Sherman wrote: You know, this problem would go away, almost entirely, if we had a :f[ull] adverb for regex matching that imposed ^[...]$ around the entire match. Then your code becomes:  m:f/[A..Z]+|[a..z]+/ for grins, :f[ull]l[ine] could use ^^ and $$. I suspect :full would almost

Re: S26 broken link

2010-08-02 Thread Jon Lang
Moritz Lenz wrote: Offer Kaye wrote: The link to the S26 Synopsis on http://perlcabal.org/syn/ points to http://perlcabal.org/syn/S26.html which is a broken link - would it be possible to fix this? I't not that easy, because we currently don't have tool to turn p6doc into HTML. I can remove

Re: Suggested magic for a .. b

2010-07-30 Thread Jon Lang
Aaron Sherman wrote: In the end, I'm now questioning the difference between a junction and a Range... which is not where I thought this would go. Conceptually, they're closely related. In particular, a range behaves a lot like an any() junction. Some differences: 1. An any() junction always

Re: Suggested magic for a .. b

2010-07-29 Thread Jon Lang
On Wed, Jul 28, 2010 at 10:35 PM, Brandon S Allbery KF8NH allb...@ece.cmu.edu wrote:  On 7/28/10 8:07 PM, Michael Zedeler wrote: On 2010-07-29 01:39, Jon Lang wrote: Aaron Sherman wrote: In smart-match context, a..b includes aardvark. No one has yet explained to me why that makes sense

Re: Suggested magic for a .. b

2010-07-28 Thread Jon Lang
Dave Whipp wrote: To squint at this slightly, in the context that we already have 0...1e10 as a sequence generator, perhaps the semantics of iterating a range should be unordered -- that is,  for 0..10 - $x { ... } is treated as  for (0...10).pick(*) - $x { ... } Then the whole question

Re: Suggested magic for a .. b

2010-07-28 Thread Jon Lang
TSa wrote: Swapping the endpoints could mean swapping inside test to outside test. The only thing that is needed is to swap from to ||:   $a .. $b   # means  $a = $_ $_ = $b  if $a $b   $b .. $a   # means  $b = $_ || $_ = $a  if $a $b This is the same sort of discontinuity of meaning

Re: Suggested magic for a .. b

2010-07-28 Thread Jon Lang
Darren Duncan wrote: Does ... also come with the 4 variations of endpoint inclusion/exclusion? If not, then it should, as I'm sure many times one would want to do this, say:  for 0...^$n - {...} You can toggle the inclusion/exclusion of the ending condition by choosing between ... and ...^;

Re: Suggested magic for a .. b

2010-07-28 Thread Jon Lang
Aaron Sherman wrote: In smart-match context, a..b includes aardvark. No one has yet explained to me why that makes sense. The continued use of ASCII examples, of course, doesn't help. Does a .. b include æther? This is where Germans and Swedes, for example, don't agree, but they're all

Re: Suggested magic for a .. b

2010-07-28 Thread Jon Lang
Michael Zedeler wrote: Jon Lang wrote: This is definitely something for the Unicode crowd to look into.  But whatever solution you come up with, please make it compatible with the notion that aardvark..apple can be used to match any word in the dictionary that comes between those two words

Re: Suggested magic for a .. b

2010-07-27 Thread Jon Lang
Aaron Sherman wrote: As a special case, perhaps you can treat ranges as special and not as simple iterators. To be honest, I wasn't thinking about the possibility of such special cases, but about iterators in general. You can't generically reverse lazy constructs without running afoul of the

Re: series operator issues

2010-07-22 Thread Jon Lang
On Thu, Jul 22, 2010 at 9:25 AM, Aaron Sherman a...@ajs.com wrote: On Thu, Jul 22, 2010 at 11:41 AM, Moritz Lenz mor...@faui2k3.org wrote: The difficulty you're running into is that you're trying to use the wrong tool for the job. Just don't use the series operator when it's not easy to use.

Re: series operator issues

2010-07-22 Thread Jon Lang
On Thu, Jul 22, 2010 at 11:35 AM, Aaron Sherman a...@ajs.com wrote: On Thu, Jul 22, 2010 at 1:13 PM, Jon Lang datawea...@gmail.com wrote:  Yes, it would be a special tool; but it would be much more in keeping with the keep simple things easy philosophy that Perl 6 tends to promote:    0

Re: Suggested magic for a .. b

2010-07-21 Thread Jon Lang
Smylers wrote: Jon Lang writes: Approaching this with the notion firmly in mind that infix:.. is supposed to be used for matching ranges while infix:... should be used to generate series: With series, we want C $LHS ... $RHS to generate a list of items starting with $LHS and ending

Re: multi-character ranges

2010-07-21 Thread Jon Lang
Aaron Sherman wrote: Darren Duncan wrote: 3) It seems that there are two competing multi-character approaches and both seem somewhat valid. Should we use a pragma to toggle behavior between A and B:  A: aa .. bb contains az  B: aa .. bb contains ONLY aa, ab, ba and bb I would find A to

Re: Suggested magic for a .. b

2010-07-20 Thread Jon Lang
Solomon Foster wrote: Ranges haven't been intended to be the right way to construct basic loops for some time now.  That's what the ... series operator is for.    for 1e10 ... 1 - $i {         # whatever    } is lazy by the spec, and in fact is lazy and fully functional in Rakudo.  

Re: Suggested magic for a .. b

2010-07-20 Thread Jon Lang
Approaching this with the notion firmly in mind that infix:.. is supposed to be used for matching ranges while infix:... should be used to generate series: Aaron Sherman wrote: Walk with me a bit, and let's explore the concept of intuitive character ranges? This was my suggestion, which seems

Re: Suggested magic for a .. b

2010-07-20 Thread Jon Lang
Aaron Sherman wrote: So, what's the intention of the range operator, then? Is it just there to offer backward compatibility with Perl 5? Is it a vestige that should be removed so that we can Huffman ... down to ..? I'm not trying to be difficult, here, I just never knew that ... could

Re: Suggested magic for a .. b

2010-07-20 Thread Jon Lang
Mark J. Reed wrote: Perhaps the syllabic kana could be the integer analogs, and what you get when you iterate over the range using ..., while the modifier kana would not be generated by the series  ア ... ヴ but would be considered in the range  ア .. ヴ?  I wouldn't object to such script-specific

Re: Suggested magic for a .. b

2010-07-16 Thread Jon Lang
Aaron Sherman wrote: Oh bother, I wrote this up last night, but forgot to send it. Here y'all go: I've been testing .. recently, and it seems, in Rakudo, to behave like Perl 5. That is, the magic auto-increment for a .. z works very wonkily, given any range that isn't within some very

Re: Perl 6 in non-English languages

2010-06-23 Thread Jon Lang
Another thing to consider is that Perl 6 is symbol-heavy: that is, keywords are often symbols (such as , =, or $_) rather than words. AFAIK, those symbols are not English, and I would not expect them to change under a natural language transformation of the setting. And to elaborate on Aaron's

Re: r31050 -[S03] refine hyper dwimminess to be more like APL, with modular semantics

2010-06-02 Thread Jon Lang
Smylers wrote: pugs-comm...@feather.perl6.nl writes: Author: lwall Log: [S03] refine hyper dwimminess to be more like APL, with modular semantics +    (1,2,3)   »+» 1       # 2,4,4,6     rhs dwims to (1 xx *).batch(3) I'd've expected the output to be 2,3,4; is the 2,4,4,6 copy pasta or am

Re: r31054 -[S03] suggestions from dataweaver++

2010-06-02 Thread Jon Lang
pugs-comm...@feather.perl6.nl wrote: +Regardless of whether the dwim is forced or emergent from the shapes +of the arrays, once the side to dwim on has been chosen, the dwim +semantics on the dwimmy side are always: + +    (@dwimmyside xx *).batch(@otherside.elems) + +This produces a list

Re: r31051 -[S02] refine Blobs to simply be immutable Bufs, with similar generic characteristics

2010-06-02 Thread Jon Lang
Darren Duncan wrote: With the above addition, you have both Buf and Blob roles as well as Buf and Blob types. I think you need to make each of those just a role or a type, and then add another named entity which is the counterpart role or type. For example, as you have Stringy as a role

Re: Proposal for a new Temporal time-measurement paradigm

2010-04-24 Thread Jon Lang
Darren Duncan wrote: I think that the most thorough solution is to just take it for granted that there are multiple reference timelines/calendars and that in general it is impossible to reconcile them with each other. Taking this to its logical extreme, there might be a few (admittedly fringe)

Re: Proposal for a new Temporal time-measurement paradigm

2010-04-22 Thread Jon Lang
Why do I find myself thinking of roles and classes here? IMHO, we should have a role that represents abstractly a moment in time. This role should, in and of itself, not be tied to any particular calendar; its purpose is so that one can write functions that make reference to instances in time

Re: r30357 - docs/Perl6/Spec/S32-setting-library

2010-04-11 Thread Jon Lang
Log: [Numeric] Move sqrt to Numeric. Remove incorrect return value type of roots.   Move cis and unpolar to Real.  Add to-radians and from-radians to Numeric. The return value for roots should have been corrected (to List of Numeric), not removed. -- Jonathan Dataweaver Lang

Re: A common and useful thing that doesn't appear to be easy in Perl 6

2010-04-07 Thread Jon Lang
Damian Conway wrote: I do like the idea of being able to specify the sequence of values of an enumeration by using a series of some kind. And I must say the one that feels most natural is the one that plays on the equivalence of underlying equivalence of enums and constants, namely:    enum

Re: A common and useful thing that doesn't appear to be easy in Perl 6

2010-04-07 Thread Jon Lang
One more idea: could you implement the sort of thing being asked for by means of a buffer? That is, what's the difference between the bitset being asked for and a Buf[boolean]? And could those differences be addressed by composing a Buf[boolean] into a more appropriate role? Note also that Perl

Re: numerics, roles, and naming

2010-03-14 Thread Jon Lang
Ruud H.G. van Tol wrote: Did you consider discrete? I think that Discrete could work quite well as the role that encapsulates the ways in which Integer and Gauss are alike. It may even be genralizable beyond that, although there might be some discord between theory and practice. (In theory,

Re: numerics, roles, and naming

2010-03-14 Thread Jon Lang
Darren Duncan wrote: I'm inclined to consider a Discrete to be broad enough to include Boolean, as well as every single enum type in general; it would also include Order, say.  So I would also then add a more specific something, say DiscreteNumeric. There are discrete things that are not

Re: numerics, roles, and naming

2010-03-12 Thread Jon Lang
Darren Duncan wrote: 2.  There doesn't seem to be a role for complex as there is for integer or rational or real or numeric.  So, if the boxed Perl complex number is called Complex and the machine native one is called complex or complex128 or whatever, what would one name the role that is

Re: built-in roles/types routine boundary

2010-03-08 Thread Jon Lang
On Mon, Mar 8, 2010 at 12:40 PM, Darren Duncan dar...@darrenduncan.net wrote: Starting with the context of this piece of Synopsis 2:  These types do (at least) the following roles:    Class       Roles    =       =    Str         Stringy    Bit         Numeric Boolean Integral    

Re: The silliness of max()

2010-03-07 Thread Jon Lang
Moritz Lenz wrote: Please take a look at http://rt.perl.org/rt3/Ticket/Display.html?id=73356: moritz_ rakudo: say max(1..5) p6eval rakudo c05478: OUTPUT«-Inf␤» * masak submits rakudobug for max(1..5) The weird thing is that it is right, according to the current spec. It says  our multi

Re: Gripes about Pod6 (S26)

2010-02-10 Thread Jon Lang
John Gabriele wrote: Personally, I've always thought that Perl has a very natural feel to it, and deserves a doc markup format that's also natural: [Markdown] (and [Pandoc]'s Markdown has just the right additions, IMO). [Markdown]: http://daringfireball.net/projects/markdown/ [Pandoc]:

Re: One-pass parsing and forward type references

2010-02-01 Thread Jon Lang
Larry Wall wrote: But also note that there are several other ways to predeclare types implicitly.  The 'use', 'require', and 'need' declarations all introduce a module name that is assumed to be a type name. Just to clarify: it's possible to define a module within a file, rather than as a

Re: Custom errors on subsets?

2010-01-05 Thread Jon Lang
Perhaps you could create an error function that temporarily sets the default error message (does perl 6 still have the $! variable?) and returns false; so: subset Filename of Str where { $_ ~~ :f or error ( No such file: '$_' ) } Of course, that's a rather narrowly-defined function, as it's

Re: r29381 - docs/Perl6/Spec

2009-12-19 Thread Jon Lang
On Sat, Dec 19, 2009 at 1:07 PM, pugs-comm...@feather.perl6.nl wrote:  for the most generic non-failure undefined value.  The CAny type,  derived from CMu, is also undefined, but excludes Cjunctions so  that autothreading may be dispatched using normal multiple dispatch -rules.  The CWhatever

Re: Comments on S32/Numeric#Complex

2009-12-17 Thread Jon Lang
Dave Whipp wrote: Moritz Lenz wrote: Dave Whipp wrote: [cut] Contrast with Rat which has both separate accessors and the nude method (a name that could possibly be improved to avoid adult-content filters) suggestions welcome. Attempting to generalize: what we want is an operator that

Re: Comments on S32/Numeric#Complex

2009-12-17 Thread Jon Lang
Dave Whipp wrote: Jon Lang wrote:  my ($num, $denom) = $num.^attr; # $num.WHAT == Ratio;  my ($mag, $phase) = Complex::Polar($z).^attr;  my ($re, $im) = Complex::Cartesian($z).^attr;  my ($x, $y) = $vector.^attr »·« ( [1, 0], [0, 1] ); If I'm reading this right, the .^attr is exposing

Re: Comments on S32/Numeric#Complex

2009-12-16 Thread Jon Lang
On Wed, Dec 16, 2009 at 2:10 PM, Dave Whipp d...@dave.whipp.name wrote: The definition of the Complex type seems a little weak. A few things: To get the Cartesian components of the value there are two methods (re and im). In contrast there is just one method polar to return the polar

Re: But vs. With

2009-12-03 Thread Jon Lang
On Thu, Dec 3, 2009 at 6:38 PM, David Green david.gr...@telus.net wrote: I'm wondering whether we can make use of the contrary sense implied by the word but, and have it apply specifically to cases where something is being overridden.  In cases where there isn't something to override we could

Re: r29111 - docs/Perl6/Spec

2009-11-18 Thread Jon Lang
Moritz Lenz wrote: Given the above, if one wants to construct a full-precision rational value in terms of 3 Int values analogous to a mantissa and radix and exponent, what is the best way to write it in Perl 6? For example, say I want the following expression to result in a FatRat because

Re: unusual invocants

2009-10-21 Thread Jon Lang
Jonathan Worthington wrote: Ovid wrote: I was asking the special case where: 1. A class consumes two (or more) roles 2. Each roles provides a method with an identical signature 3. The methods are not equivalent and neither role can rely on the other's method  With that, you have roles

Re: unusual invocants

2009-10-21 Thread Jon Lang
TSa wrote: Jon Lang wrote: I have some more thoughts on this; but I'm on a time crunch at the moment, and would really like to get some feedback on the above before proceeding further: have I missed anything in my reasoning? I fully understand what you mean, I hope. But note that all

lvalue methods

2009-10-20 Thread Jon Lang
I recently attempted to write a sample mutable role that made use of a number of lvalue methods, and I had a bear of a time getting it to work. Could we arrange for a more intuitive option to be available? For example, allow the programmer to pass a writer code block in through the rw trait, and

Re: Aliasing methods in CPAN roles

2009-10-19 Thread Jon Lang
Raphael Descamps wrote: I personally don't understand why we don't have a exclude and alias operator in Perl 6 but I have not read all the synopses and don't have an overview. I don't think that it's explicitly spelled out anywhere; but the reason is fairly straightforward: exclude and alias

unusual invocants

2009-10-19 Thread Jon Lang
In Aiasing methods in CPAN roles, David Green wrote: Jon Lang wrote: David Green wrote: I would expect that role Logging { method log(Numeric $x:) {...} } means the invocant is really of type Numeric Logging, without Logging having to do Numeric.  On the other hand, I can see that strictly

Re: Aliasing methods in CPAN roles

2009-10-19 Thread Jon Lang
Raphael Descamps wrote: In the original traits paper the aliasing is not deep: to respect the flattening property, the semantic of the role must not change, so aliasing a recursive method will call the original method. It's a known theoretical weakness of the traits paper and freezing roles

Re: unusual invocants

2009-10-19 Thread Jon Lang
David Green wrote: Jon Lang wrote: In Aiasing methods in CPAN roles, David Green wrote: I don't want my special log() method to work only for other types that explicitly do NumLog; I want it to work for any type that directly does Numeric does Logging. But if Logging doesn't do Numeric

Re: Aliasing methods in CPAN roles

2009-10-18 Thread Jon Lang
David Green wrote: Jon Lang wrote: This implies that both Logging and Math do Numeric, since the invocant ought to be of a type that the class does. I would expect that    role Logging { method log(Numeric $x:) {...} } means the invocant is really of type Numeric Logging, without Logging

Re: Aliasing methods in CPAN roles

2009-10-17 Thread Jon Lang
David Green wrote: Aha, so the bark:(Dog:) syntax identifies the method by its signature as well, thus distinguishing it from the .bark:(Tree:) method.  This works fine when the sigs can distinguish the invocants, which is very common.  However, I could have ambiguous methods even including

Re: Freezing role methods

2009-10-14 Thread Jon Lang
Ovid wrote: The only way to handle this appears to be renaming one of the x() methods and trying to track down all code which relies on it and changing it.  This essentially violates the problem we're trying to solve with traits, er, roles. In short, under the original traits model, you have

Re: Freezing role methods

2009-10-14 Thread Jon Lang
David Green wrote: Or to look at it the other way around:  Since we refer to things by name, those names have to be unique everywhere; so let's start out with long, fully-qualified names everywhere: $dog.Dog::bark(), $tree.Tree::bark(), $i.Int::succ, etc.  Now everything's fine -- except that

Re: Freezing role methods

2009-10-14 Thread Jon Lang
David Green wrote: Jon Lang wrote: David Green wrote: On the other hand, $dogwood.Dog::bark cannot be simplified by leaving out the Dog:: because then it would be ambiguous. On the gripping hand, if we have a function train(Dog $d), then we can safely assume that within the lexical scope

Re: Freezing role methods

2009-10-14 Thread Jon Lang
Darren Duncan wrote: Jon Lang wrote: Here, we need a bit of a clarification: are we talking roles or classes?  Real example: Numeric is a role; Num is a class.  Both can be used in signatures; but only classes can be used to create objects.  That is, my Num $x; works; but my Numeric $x

Overloading Roles

2009-10-05 Thread Jon Lang
Consider a Range role that is parameterized (i.e., Range of T is a perfectly valid thing to do). According to the spec, the definition of Range depends on the nature of T: * If the lower bound is Numeric, certain coercion rules are attempted on the upper bound; otherwise, the two boundaries must

Re: generality of Range

2009-10-04 Thread Jon Lang
yary wrote: I'm confused between using ranges to generate a lazy list and using them as criteria to match against. Indeed. It was my understanding that there was a recent change to Ranges so that they now exist primarily to be used as matching criteria. If you wish to generate a list, the

Re: r28597 - docs/Perl6/Spec/S32-setting-library

2009-10-04 Thread Jon Lang
How do pred and succ work when given Complex values? More generally: if Complex does Numeric, then Numeric doesn't include Ordered (or whatever it's called), because Complex doesn't do Ordered. As such, you can't used Numeric for any function that depends on the value being Ordered. On Sun, Oct

Re: r28597 - docs/Perl6/Spec/S32-setting-library

2009-10-04 Thread Jon Lang
Moritz Lenz wrote: Jon Lang wrote: typos: s[Nuermic] = Numeric You do have a pugs commit bit, don't you? A what? AFAICT, I don't have any way of editing the Synopses; all I can do is to comment on what I find. -- Jonathan Dataweaver Lang

Re: r28523 - docs/Perl6/Spec/S32-setting-library

2009-10-01 Thread Jon Lang
On Wed, Sep 30, 2009 at 11:58 PM, pugs-comm...@feather.perl6.nl wrote: Author: moritz Date: 2009-10-01 08:58:00 +0200 (Thu, 01 Oct 2009) New Revision: 28523 Modified:   docs/Perl6/Spec/S32-setting-library/Numeric.pod Log: [S32::Num] More thoughts on Inf/NaN Complex, and on comparing

Re: object possible representations (was Re: r28523 - ...)

2009-10-01 Thread Jon Lang
Darren Duncan wrote: Jon Lang wrote: I'm not sure that I feel comfortable locking CComplex into rectilinear coordinates as its internal storage method, as there will be cases where the code operates more smoothly if you're using polar coordinates to store the numbers: we should leave

Re: object possible representations (was Re: r28523 - ...)

2009-10-01 Thread Jon Lang
Some further thoughts: Essentially, this could be done as an extension of the versioning system. The difference between possrep versioning and normal versioning would lie in the means by which the possrep dimension would be resolved if not specified. Namely, the compiler would make the decision

Re: r28528 - in docs/Perl6/Spec: . S32-setting-library

2009-10-01 Thread Jon Lang
On Thu, Oct 1, 2009 at 9:53 AM, pugs-comm...@feather.perl6.nl wrote:  The Perl 6 equivalent to Perl 5's Ceval {...} is Ctry {...}.  (Perl 6's Ceval function only evaluates strings, not blocks.) -A Ctry block by default has a CCATCH block that handles all +A Ctry block by default has a CCATCH

Re: updated num/str/etc roles/types (was Re: r28502 ...)

2009-09-29 Thread Jon Lang
Darren Duncan wrote: These generally look like good changes, but I have a few points on which I'd like clarification or to make suggestions. +Perl supports generic types through what are called roles +which represent capabilities or interfaces.  These roles +are generally not used directly

Re: updated num/str/etc roles/types (was Re: r28502 ...)

2009-09-29 Thread Jon Lang
Darren Duncan wrote: Jon Lang wrote: So what about custom delimiters? q:21100100101 q:8[57013] q:16~DEADBEEF~ Well, sure, if its useful; the idea is to amalgam numeric and Str syntax. However, because a Blob literal presumably just has 0..9,A-Z,_ characters in its payload, one

Re: r28339 - docs/Perl6/Spec

2009-09-21 Thread Jon Lang
On Mon, Sep 21, 2009 at 12:01 PM, pugs-comm...@feather.perl6.nl wrote: @@ -65,9 +65,9 @@  The basic underlying concept is that a Parcel behaves much like a  list, but it doesn't enforce any context, in a way that no flattening -or coercion is made. When you use the Positional API on a Parcel,

Re: S26 - The Next Generation

2009-09-17 Thread Jon Lang
Not actually S26; but closely related: should $=POD and .WHY be read-only? Also, should there be other Pod variables besides $=POD? If so, which ones? Back on the subject of S26: should declarator blocks and aliases be able to introspect the object with which they're associated? That is, should

Re: S26 - The Next Generation

2009-09-07 Thread Jon Lang
Damian Conway wrote: Raiph elucidated: I was thinking it would be possible to reference (compiler) variables representing eg. the name and sig of a block being parsed, or a block or declaration which has just been parsed, or which is just about to be parsed, and that simply referencing these

Re: S26 - The Next Generation

2009-09-07 Thread Jon Lang
Damian Conway wrote: Jon Lang kept his promise: I promised some further thoughts; here they are: Much appreciated. You're welcome. As written, declarator aliasing attaches the alias to a piece of code, and draws both the name and the alias from that.  What about using a special case

Re: Synopsis 02: Range objects

2009-08-31 Thread Jon Lang
On Mon, Aug 31, 2009 at 12:42 AM, TSa thomas.sandl...@vts-systems.de wrote: HaloO, Jon Lang wrote: '' and '=' numify their arguments before comparing them. 'lt' and 'le' stringify their arguments before comparing them. 'before' compares its arguments without any coercion.  Note

Re: Synopsis 02: Range objects [recap]

2009-08-27 Thread Jon Lang
On Thu, Aug 27, 2009 at 2:59 AM, Jon Langdatawea...@gmail.com wrote: Michael Zedeler wrote: Jon Lang wrote: As for Str, I'm not sure that we should go so far as to say that you _can't_ create RangeIterators over them, so much as to say that the default step algorithm is defined only

Re: Synopsis 02: Range objects

2009-08-27 Thread Jon Lang
smuj wrote: TSa wrote: HaloO, David Green wrote: For certain discrete ordered types, like Int, both ways work out the same, and since Ints are the most common and most obvious use for Ranges, it's easy to overlook the confusion.  The case with strings is a good example: it really doesn't

Re: Synopsis 02: Range objects

2009-08-27 Thread Jon Lang
On Thu, Aug 27, 2009 at 2:36 PM, Mark J. Reedmarkjr...@gmail.com wrote: I think $a = $^x = $b is short enough, and lets you choose between and = on both ends and without having to remember how many dots each maps to. How many dots? Note that there are three sets of comparison operators: ''

Re: Synopsis 02: Range objects

2009-08-27 Thread Jon Lang
smuj wrote: So you're saying you'd like things to stay exactly as they are at the moment!? :-) Not quite. I'd like to see the effects of context spelled out more clearly than they are; and I'd like a revision so that '..' numifies its endpoints while a new 'to' operator doesn't. That is,

Re: Synopsis 02: Range objects

2009-08-27 Thread Jon Lang
On Thu, Aug 27, 2009 at 2:34 PM, Larry Wallla...@wall.org wrote: On Thu, Aug 27, 2009 at 02:21:12PM -0700, Jon Lang wrote: :     2.5 ~~ 1..5 # true: equivalent to 2.5 ~~ 1 = $_ = 5. Current specced behavior for Range objects. :     2.5 ~~ @(1..5) # false: equivalent to 2.5 ~~ (1, 2, 3, 4, 5

Re: Synopsis 02: Range objects [recap]

2009-08-26 Thread Jon Lang
Michael Zedeler wrote: Proposed changes: It shouldn't be possible to construct RangeIterators over Str (apart from single length strings) or Complex using the Range operator (..). I'd go one step further with Complex, to say that Range isn't a useful concept at all so long as before and after

Re: S26 - The Next Generation

2009-08-25 Thread Jon Lang
I promised some further thoughts; here they are: As written, declarator aliasing attaches the alias to a piece of code, and draws both the name and the alias from that.  What about using a special case of the declarator block for this?  That is:    class Database::Handle { #=alias        has IO

Re: Synopsis 02: Range objects

2009-08-25 Thread Jon Lang
Michael Zedeler wrote: The obvious (default) choice for a step size would be the precision of the more precise of the two values.  So 0.0001 in your example above. Well... maybe. How do you specify the intended precision, then? If I want the values from 1 to 2 with step size 0.01, I guess

Re: Synopsis 02: Range objects

2009-08-25 Thread Jon Lang
Mark J. Reed wrote: On Tue, Aug 25, 2009 at 5:58 PM, Jon Langdatawea...@gmail.com wrote: Also, I want to second David Green's point: we're not talking Range and Interval here; we're talking Range and Series. But a series refers to a more general concept than a discrete range.  I still think

  1   2   3   4   >