Re: how to write literals of some Perl 6 types?

2008-12-04 Thread Moritz Lenz
Jon Lang wrote: Darren Duncan wrote: Now, with some basic types, I know how to do it, examples: Bool # Bool::True Please forgive my ignorance; but are there any cases where 'Bool::True' can be spelled more concisely as 'True'? There are; As long as the short name is unambiguous, it

Regex - Accessing captured subrules could be problematic

2008-12-04 Thread GW
Hi, I found something that could be problematic (haven't yet found out if it should be a special case) in Synopsis 5. More precisely it is under the chapter Accessing captured subrules in the test case t/regex/from_perl6_rules/capture.t lines 67–71: ok(eval(' bookkeeper ~~ m/single ($/single)/

Re: Files, Directories, Resources, Operating Systems

2008-12-04 Thread Aristotle Pagaltzis
* Tom Christiansen [EMAIL PROTECTED] [2008-11-27 11:30]: In-Reply-To: Message from Darren Duncan [EMAIL PROTECTED] of Wed, 26 Nov 2008 19:34:09 PST. [EMAIL PROTECTED] I believe that the most important issues here, those having to do with identity, can be discussed and solved without

Re: Support for ensuring invariants from one loop iteration to the next?

2008-12-04 Thread Aristotle Pagaltzis
* [EMAIL PROTECTED] [EMAIL PROTECTED] [2008-12-03 21:45]: loop { doSomething(); next if someCondition(); doSomethingElse(); } I specifically said that I was aware of this solution and that I am dissatisfied with it. Did you read my mail? * Jon Lang [EMAIL PROTECTED] [2008-12-03

Re: Files, Directories, Resources, Operating Systems

2008-12-04 Thread Mark Overmeer
* Aristotle Pagaltzis ([EMAIL PROTECTED]) [081204 14:38]: Furthermore, from the point of view of the OS, even treating file names as opaque binary blobs is actually fine! Programs don’t care after all. In fact, no problem shows up until the point where you try to show filenames to a user; that

Re: Support for ensuring invariants from one loop iteration to the next?

2008-12-04 Thread Aristotle Pagaltzis
* Mark J. Reed [EMAIL PROTECTED] [2008-12-03 20:30]: OK, so let's look at the general problem. The structure is this: doSomething(); while (someCondition()) { doSomethingElse(); doSomething(); } ...and you want to factor out the doSomething() call so that it only has to be

Re: Support for ensuring invariants from one loop iteration to the next?

2008-12-04 Thread Aristotle Pagaltzis
* David Green [EMAIL PROTECTED] [2008-12-03 22:00]: FIRST{} can do something on only the first iteration through the loop, but there's no NOT-FIRST block to do something on the second and subsequent iterations. Is there an elegant way to do something on all but the first loop? Not with a

why infix:div:(Int, Int -- Rat)

2008-12-04 Thread TSa
HaloO, I realized from the typed literal thread that S03 now explicitly states that div on two Ints returns a Rat. I remember the state of affairs being that it returns an Int that adheres to the division of an Int $y by another Int $x such that $y == ($y div $x) * $x + ($y mod $x) holds

Re: Files, Directories, Resources, Operating Systems

2008-12-04 Thread Aristotle Pagaltzis
* Mark Overmeer [EMAIL PROTECTED] [2008-12-04 16:50]: * Aristotle Pagaltzis ([EMAIL PROTECTED]) [081204 14:38]: Furthermore, from the point of view of the OS, even treating file names as opaque binary blobs is actually fine! Programs don’t care after all. In fact, no problem shows up until

Re: how to write literals of some Perl 6 types?

2008-12-04 Thread TSa
HaloO, David Green wrote: Using int8 vs Int is presumably a performance issue, but int8 29 and Int 29 *mean* the same thing, so they should be ===. An Enum doesn't mean the same thing as a plain Int, so it shouldn't. IIRC, === is defined to compare only values from the same type domain. For

Re: how to write literals of some Perl 6 types?

2008-12-04 Thread TSa
HaloO, David Green wrote: Using int8 vs Int is presumably a performance issue, but int8 29 and Int 29 *mean* the same thing, so they should be ===. An Enum doesn't mean the same thing as a plain Int, so it shouldn't. And how about 'Num 1.0 === Complex(1,0) === Int 1'? Should all these be

Re: why infix:div:(Int, Int -- Rat)

2008-12-04 Thread David Green
On 2008-Dec-4, at 9:42 am, TSa wrote: I remember the state of affairs being that [div] returns an Int Something more explicit like idiv was suggested for integral division. Personally, I'm happy not to have anything special provided for it, on the grounds that having to say, e.g.

Re: Regex - Accessing captured subrules could be problematic

2008-12-04 Thread Moritz Lenz
Hello, GW wrote: I found something that could be problematic (haven't yet found out if it should be a special case) in Synopsis 5. More precisely it is under the chapter Accessing captured subrules in the test case t/regex/from_perl6_rules/capture.t lines 67–71: ok(eval(' bookkeeper ~~

Re: Regex - Accessing captured subrules could be problematic

2008-12-04 Thread Jonathan Scott Duff
On Wed, Dec 3, 2008 at 6:19 PM, GW [EMAIL PROTECTED] wrote: Hi, I found something that could be problematic (haven't yet found out if it should be a special case) in Synopsis 5. More precisely it is under the chapter Accessing captured subrules in the test case

Re: why infix:div:(Int, Int -- Rat)

2008-12-04 Thread Mark J. Reed
On Thu, Dec 4, 2008 at 3:26 PM, David Green [EMAIL PROTECTED] wrote: Something more explicit like idiv was suggested for integral division. Personally, I'm happy not to have anything special provided for it, on the grounds that having to say, e.g. floor($i/$j), forces you to be blatantly

Re: how to write literals of some Perl 6 types?

2008-12-04 Thread Leon Timmermans
On Thu, Dec 4, 2008 at 6:34 PM, TSa [EMAIL PROTECTED] wrote: HaloO, And how about 'Num 1.0 === Complex(1,0) === Int 1'? Should all these be identical irrespective the fact that they come from three different type domains? How is that implemented? IMHO the spec on === is quite clear: two