Re: Test Case: Complex Numbers

2005-11-14 Thread Dave Whipp
Jonathan Lang wrote: In the hypothetical module that I'm describing, the principle value approach _would_ be used - in scalar context. The only time the "list of all possible results" approach would be used would be if you use list context. If you have no need of the list feature, then you don

Re: HLL Debug Segments

2005-11-15 Thread Dave Whipp
Will Coleda wrote: Right, the hard bit here was that I needed to specify something other than "file". Just agreeing that we need something other than just "file/line". I'd have thought the onus is the other way: justify the use of "file/line" as the primitive concept. We're going to have

Re: \x{123a 123b 123c}

2005-11-22 Thread Dave Whipp
Larry Wall wrote: And there aren't that many regexish languages anyway. So I think :syntax is relatively useless except for documentation, and in practice people will almost always omit it, which makes it even less useful, and pretty nearly kicks it over into the category of multiplied entities

Re: relational data models and Perl 6

2005-12-15 Thread Dave Whipp
Darren Duncan wrote: As an addendum to what I said before ... ... I would want the set operations for tuples to be like that, but the example code that Luke and I expressed already, with maps and greps etc, seems to smack too much of telling Perl how to do the job. I don't want to have to us

Re: Table of Perl 6 "Types"

2006-01-04 Thread Dave Whipp
Larry Wall wrote: : - : Num : : Base Numeric type : Int : : : Float : : : Complex : : This bothers me. The reason we put in Num in the first pla

Re: Table of Perl 6 "Types"

2006-01-12 Thread Dave Whipp
>>(perhaps this discussion belongs on p6l) > It sure does;) (this reply moved to p6l) [EMAIL PROTECTED] wrote: Dave Whipp wrote: An Int is Enumerable: each value that is an Int has well defined succ and pred values. Conversely, a Real does not -- and so arguably should not support t

Re: Table of Perl 6 "Types"

2006-01-12 Thread Dave Whipp
Rob Kinyon wrote: I wouldn't see a problem with defining a "Real" role that has a fairly sparse set of operations. Afterall, a type that does support ++ and -- (e.g. Int, Num) could easily "does Enumerable" if it wants to declare that it supports them. What about the scripty-doo side of Perl6?

Pattern matching and "for" loops

2006-01-13 Thread Dave Whipp
Today I wrote some perl5 code for the umpteenth time. Basically: for( my $i=0; $i< $#ARGV; $i++ ) { next unless $ARGV[$i] eq "-f"; $i++; $ARGV[$i] = absolute_filename $ARGV[$i]; } chdir "foo"; exec "bar", @ARGV; I'm trying to work out if there's a clever perl6 way to wri

Re: Pattern matching on arrays and "for" loops

2006-01-13 Thread Dave Whipp
Luke Palmer wrote: On 1/13/06, Dave Whipp <[EMAIL PROTECTED]> wrote: Would this actually work, or would it stop at the first elem that doesn't match ("-f", ::Item)? If by "stop" you mean "die", yes it would stop. not what I wanted :-( Is there s

something between "state" and "my"

2006-02-02 Thread Dave Whipp
(from p6i) Larry Wall wrote: On Thu, Feb 02, 2006 at 07:12:08PM +0100, Leopold Toetsch wrote: : >... Anyway, : >the P6 model of "state" is more like a persistent lexical than like : >C's static. : : Sorry for my dumb question - what's the difference then? (Besides that C : dosn't have closur

Re: something between "state" and "my"

2006-02-03 Thread Dave Whipp
Larry Wall wrote: But that's just my current mental model, which history has shown is subject to random tweakage. And maybe "env $+result" could be a special squinting construct that does create-unless-already-created. Doesn't feel terribly clean to me though. If we stick with the + twigil alw

Re: comment scope

2006-03-14 Thread Dave Whipp
Ruud H.G. van Tol wrote: Perl6 could introduce (lexical, nestable) comment scope. In P5 I often us q{...} in void context -- P6 seems to be attaching tags to the quote operator, so q:comment{...} might fall out naturally.

Capture Object: why no verb?

2006-04-17 Thread Dave Whipp
Reading about capture objects, I see that they represent an arglist, and the the object to which you going to send those args. What is doesn't capture is the method name (the verb) that's being called. This feels like a slightly strange ommission. Compare: $message = &Shape::draw.prebind( x

Re: Capture Object: why no verb?

2006-04-22 Thread Dave Whipp
Audrey Tang wrote: > Hm, Perl 6 actually has two different ways of putting Capture to some > Code object... Following yesterday's P6AST draft I'll call them Call and > Apply respectively: > > moose($obj: 1, 2); # this is Call > &moose.($obj: 1, 2); # this is Apply > > elk(named

error building pugs: "Could not find module `Data.ByteString'"

2006-04-30 Thread Dave Whipp
I'm trying play with pugs for the first time. I checked it out from the repository (r10142) and, after installing ghc 6.4.2, attempted to build pugs. Fairly quickly, the build dies with the message below. Does anyone have any hints what the problem might be (I'm not a Haskell person yet, but I

Re: error building pugs: "Could not find module `Data.ByteString'"

2006-05-01 Thread Dave Whipp
Dave Whipp wrote: Could not find module `Data.ByteString': I updated to r10166: Audrey's update to third-party/fps/... fixed my problem. Thanks. Dave.

Why does p6 always quote non-terminals?

2006-06-27 Thread Dave Whipp
I was reading the slides from PM's YAPC::NA, and a thought drifted into my mind (more of a gentle alarm, actually). One of the examples struck me: rule parameter_list { [ , ]* } Its seems common in the higher layers of a grammar that there are more non-terminal than terminals in each rule, so

Re: ===, =:=, ~~, eq and == revisited (blame ajs!) -- Explained

2006-07-14 Thread Dave Whipp
Darren Duncan wrote: Assuming that all elements of $a and $b are themselves immutable to all levels of recursion, === then does a full deep copy like eqv. If at any level we get a mutable object, then at that point it turns into =:= (a trivial case) and stops. ( 1, "2.0", 3 ) === ( 1,2,3

Re: === and array-refs

2006-08-17 Thread Dave Whipp
David Green wrote: No, look at the example I've been using. Two arrays (1, 2, [EMAIL PROTECTED]) and (1, 2, [EMAIL PROTECTED]) clearly have different (unevaluated) contents. "eqv" only tells me whether they have the same value (when @x and @y are evaluated). That's a different question --

Re: Mutability vs Laziness

2006-09-25 Thread Dave Whipp
Aaron Sherman wrote: It seems to me that there are three core attributes, each of which has two states: Mutability: true, false Laziness: true, false Ordered: true, false I think there's a 4th: exclusivity: whether or not duplicate elements are permitted/exposed (i.e. the differe

Re: "Don't tell me what I can't do!"

2006-10-02 Thread Dave Whipp
Smylers wrote: use strict; That's different: it's _you_ that's forbidding things that are otherwise legal in your code; you can choose whether to do it or not. Which suggests that the people wanting to specify the restrictions are actually asking for a way to specify additional strictures fo

Re: "Don't tell me what I can't do!"

2006-10-02 Thread Dave Whipp
Jonathan Lang wrote: Before we start talking about how such a thing might be implemented, I'd like to see a solid argument in favor of implementing it at all. What benefit can be derived by letting a module specify additional strictures for its users? Ditto for a role placing restrictions on the

Re: "Don't tell me what I can't do!"

2006-10-02 Thread Dave Whipp
Jonathan Lang wrote: Dave Whipp wrote: Or we could view it purely in terms of the design of the core "strict" and "warnings" modules: is it better to implement them as centralised rulesets, or as a distributed mechanism by which "core" modules can register modul

Re: Synposis 26 - Documentation [alpha draft]

2006-10-08 Thread Dave Whipp
Damian Conway wrote: > Delimited blocks are bounded by C<=begin> and C<=end> markers... > ...Typenames that are entirely lowercase (for example: C<=begin > head1>) or entirely uppercase (for example: C<=begin SYNOPSIS>) > are reserved. I'm not a great fan of this concept of "reservation" when the

Re: Non-integers as language extensions (was Re: Numeric Semantics)

2007-01-04 Thread Dave Whipp
Darren Duncan wrote: For example, the extra space of putting them aside will let us expand them to make them more thorough, such as dealing well with exact vs inexact, fixed vs infinite length, fuzzy or interval based vs not, caring about sigfigs or not, real vs complex vs quaternon, etc. I

The S13 "is commutative" trait

2007-01-16 Thread Dave Whipp
Synopsys 13 mentions an "is commutative" trait in its discussion of operator overloading syntax: > Binary operators may be declared as commutative: > >multi sub infix:<+> (Us $us, Them $them) is commutative { >myadd($us,$them) } A few questions: Is this restricted to only binary op

Re: Numeric Semantics

2007-01-22 Thread Dave Whipp
Doug McNutt wrote: At 00:32 + 1/23/07, Smylers wrote: % perl -wle 'print 99 / 2' 49.5 I would expect the line to return 49 because you surely meant integer > division. Perl 5 just doesn't have a user-available type integer. I'd find that somewhat unhelpful. Especially on a one-liner, l

Coercion of non-numerics to numbers

2007-03-05 Thread Dave Whipp
I was wondering about the semantics of coercion of non-numbers, so I experimented with the interactive Pugs on feather: pugs> +"42" 42.0 pugs> +"x42" 0.0 I assume that pugs is assuming "no fail" in the interactive environment. However, Is "0.0" the correct answer, or should it be one of "undef

Re: HOWTO: Writing Perl6 Tests (was: Project Start: Section 1)

2002-11-11 Thread Dave Whipp
Garrett Goebel wrote: > Can anyone write up a detailed document describing how one would go about > writing Perl6 test cases and submitting them to Parrot? The parrot > documentation on testing, is understandably focused on testing parrot... > not the languages running on parrot. > > I can't find

Re: HOWTO: Writing Perl6 Tests (was: Project Start: Section 1)

2002-11-11 Thread Dave Whipp
"Sean O'Rourke" <[EMAIL PROTECTED]> wrote > languages/perl6/t/*/*.t is what we've got, though they're intended to > exercise the prototype compiler, not the "real language" (which looks like > it's changing quite a bit from what's implemented). OK, lets take a specific test. builtins/array.t conta

Re: HOWTO: Writing Perl6 Tests (was: Project Start: Section 1)

2002-11-11 Thread Dave Whipp
> Hm. I'm not sure how well it goes with the Perl philosophy ("the perl > language is what the perl interpreter accepts"), but we could embed the > _real_ test cases in whatever formal spec happens. This would be the > excruciatingly boring document only read by people trying to implement > perl

Re: HOWTO: Writing Perl6 Tests (was: Project Start: Section 1)

2002-11-11 Thread Dave Whipp
"Sean O'Rourke" <[EMAIL PROTECTED]> wrote in message > One thing the "golden-output" has going for it is that it gets into and > out of perl6 as quickly as possible. In other words, it relies on > perl6/parrot to do just about the minimum required of it, then passes > verification off to outside t

Re: HOWTO: Writing Perl6 Tests (was: Project Start: Section 1)

2002-11-11 Thread Dave Whipp
"Joseph F. Ryan" <[EMAIL PROTECTED]> wrote in message news:3DD0674C.1080708@;osu.edu... > A module? For something as basic as print? > I hope not, that would certainly be a pain. My understanding is that C will be a method on C (or whatever), which has a default invocant of $stdout. This module m

Re: HOWTO: Writing Perl6 Tests (was: Project Start: Section 1)

2002-11-11 Thread Dave Whipp
mbler to get the addresses of specific pass/fail labels). We don't need to go to these extremes for perl testing, because we have an exit(int) capability. exit(0) means pass: anything else (including timeout) is a fail. The fact that we don't need C is not a good argument for not using it.

Re: HOWTO: Writing Perl6 Tests (was: Project Start: Section 1)

2002-11-12 Thread Dave Whipp
Joseph F. Ryan wrote: Dave Whipp wrote: The fact that we don't need C is not a good argument for not using it. Perl tests should assume that Parrot works! Right, so whats wrong with using one of parrot's most basic ops? Thats all perl6 print is; a small wrapper around a ba

Re: HOWTO: Writing Perl6 Tests (was: Project Start: Section 1)

2002-11-12 Thread Dave Whipp
Richard Nuttall wrote: I agree with that. take the example of reverse (array) in this thread. Really, the testing should have a number of other tests to be complete, including thorough testing of boundary conditions. e.g. - tests of reverse on 0. undef 1. Empty list 2. (0..Inf) - Error ? 3. Mixe

Re: Docs Testing Format (was Re: HOWTO: Writing Perl6 Tests)

2002-11-12 Thread Dave Whipp
"Chromatic" <[EMAIL PROTECTED]> wrote: > Advantages of inline tests: > - close to the documentation > - one place to update > - harder for people to update docs without finding code Plus, it gives us a mechanism to validate example-code within documents > Disadvantages: > - doc tools must skip te

Re: Literal Values

2002-11-12 Thread Dave Whipp
> > output_is(<<'CODE', <<'OUT', "Simple Floats"); > > print 4.5; > > print 0.0; > > print 13.12343 > > CODE > > 4.50.013.12343 > > OUT > > > >I'd be more comfortable with a newline between the numbers, just in case. It's > >not an issue in the string tests. > > Alright, fine by me; I was wondering

Re: Literals, take 2

2002-11-13 Thread Dave Whipp
> except for obfuscatory purposes. Besides, if we allow dots for > floating point numbers how do we represent this integer: > > 256:234.254 Using this notation is cute: a generalization that lets us specify a strange thing. That are the reasons for using such a thing? 1) an alternative to C 2)

Re: Numeric Literals (Summary)

2002-11-14 Thread Dave Whipp
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote > exponential: > -1.23e4 # num > -1.23E4 # num (identical) And now I know why we can't use C<.> as a floating point in base 16: 1.5e1 == 15 16:1.5e1 != (1 + 5/16) * 16 There would be an ambiguity as to the meaning of 'e', so it should p

Re: Perl 6 Test Organization

2002-11-15 Thread Dave Whipp
Chromatic wrote: I'm prepared to start checking in Perl 6 tests on behalf of the Perl 6 documentation folks. These should be considered functional tests -- they are exploring the behavior we expect from Perl 6. Anything that's not yet implemented will be marked as a TODO test, and we'll figure o

Re: [Fwd: Re: Numeric Literals (Summary)]

2002-11-15 Thread Dave Whipp
Richard Nuttall wrote: How about my $a = 256:192.169.34.76; my $b = $a.base(10); my $c = '34:13.23.0.1.23.45'.base(16); This coupling makes me nervous. A number is a number: its value is not effected by its representation. I can see that, in some scripts, it might be useful to define a prope

Re: Numeric Types

2002-11-15 Thread Dave Whipp
Michael Lazzaro wrote: Does someone from internals want to take on the task of finalizing this list? We need to decide if we want to support none, some, or all of these types/aliases. - The Full List of Numeric Types In addition to the standard int and num, there are a great number of

Re: Docs Testing Format

2002-11-15 Thread Dave Whipp
Piers Cawley wrote: I'm not arguing that the unit tests themselves shouldn't carry documentation, but that documentation (if there is any) should be aimed at the perl6 developer. Depends what you mean by "perl6 developer": is that the internals people, or the lucky user? Unit tests should be

Re: Numeric Types

2002-11-15 Thread Dave Whipp
[EMAIL PROTECTED] wrote: Dave Whipp writes: > > You can rename the types if you want; but properties are a better > representation of constraints than type names: more precise, and more > flexible. > but types *are* properties . arcadi True :-( But I think my e

Re: Numeric Types

2002-11-15 Thread Dave Whipp
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote >[...] > So if you *knew* you were dealing with > 16-bit unsigned integers, you could say > > my uint16 @numarray; > > and it would generate the optimal code for such an array. You could > instead say: > > my Int @numarray is ctype("unsigned short int"

Re: Numeric Literals (Summary)

2002-11-15 Thread Dave Whipp
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote > > 1.5e1 == 15 > > 16:1.5e1 != (1 + 5/16) * 16 > > Due to ambiguities, the proposal to allow floating point in bases other > than 10 is therefore squished. If anyone still wants it, we can ask > the design team to provide a final ruling. So what about

Re: Numeric Literals (Summary)

2002-11-15 Thread Dave Whipp
A couple more corner cases: $a = 1:0; #error? or zero $b = 4294967296:1.2.3.4 # base 2**32 printf "%32x", $b; 0001000200030004 Dave.

Re: Numeric Literals (Summary)

2002-11-17 Thread Dave Whipp
Dave Storrs wrote: [...] Just as an aside, this gives me an idea: would it be feasible to allow the base to be specified as an expression instead of a constant? (I'm pretty sure it would be useful.) For example: 4294967296:1.2.3.4 # working with a really big base, hard to grok 2**32:1.2.3

Re: String concatentation operator

2002-11-18 Thread Dave Whipp
Dan Sugalski wrote: The expensive part is the shared data. All the structures in an interpreter are too large to act on atomically without any sort of synchronization, so everything shared between interpreters needs to have a mutex associated with it. Mutex operations are generally cheap, but i

Re: Design Team Issues: Numeric Types

2002-11-18 Thread Dave Whipp
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote > (A) How shall C-like primitive types be specified, e.g. for binding > to/from C library routines, etc? > >Option 1: specify as property > > my numeric $a is ctype("unsigned long int"); # standard C type > my numeric $b is ctype("my_int32"

Re: String concatentation operator

2002-11-18 Thread Dave Whipp
"Damian Conway" <[EMAIL PROTECTED]> wrote > >my $file = open "error.log" & "../some/other.log"; # I hope this is legal > > Under my junctive semantics it is. It simply calls C twice, with > the two states, and returns a conjunction of the resulting filehandles. > Though you probably really wan

Re: Help! Strings -> Numbers

2002-11-19 Thread Dave Whipp
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote: > OK, back to this, so we can finish it up: we have a number of proposals > & questions re: string-to-num conversions, and from Luke we have some > initial docs for them that need completing. Can I get more feedback on > these issues, plz, and any other

Re: String to Num (was Re: Numeric Literals (Summary))

2002-11-20 Thread Dave Whipp
"Larry Wall" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On Wed, Nov 20, 2002 at 11:57:33AM -0800, Michael Lazzaro wrote: > : and _I'm_ trying to promote the reuse of the old "oct/hex" > : functions to do a similar both-way thing, such that: > > What's

Re: Numeric Literals (Summary)

2002-11-20 Thread Dave Whipp
"Martin D Kealey" <[EMAIL PROTECTED]> wrote > I would suggest that exponent-radix should default to the same as radix. > > So > > 10:1.2.3:4.5:6== 12345 > 2:1:1:1110== 0x6000 > 60:22.0.-27::-2 == 21.9925 > For some reason, I find those almost impossible to read. We have co

Re: Perl 6 Test Organization

2002-11-20 Thread Dave Whipp
"Nicholas Clark" <[EMAIL PROTECTED]> wrote > On Thu, Nov 14, 2002 at 08:53:02PM -0800, chromatic wrote: > > Brent Dax had a nice suggestion for Perl 6 test organization. I like it > > tremendously. > > > > I repost it here to solicit comments -- to make this work, I'll need to change > > Did anyon

Re: Perl 6 Test Organization

2002-11-20 Thread Dave Whipp
"David Whipp" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] m... > > Here's an updated numbers.t file: I'm not sure that everything is > up-to-date; but I find it clearer. I fixed a few bugs, and merged in the > radii tests. > The attachments on that previous post seemed to go wrong:

Re: Perl 6 Test Organization

2002-11-20 Thread Dave Whipp
Tanton Gibbs wrote: > We also might want some way of specifying a test that will cause an > error...for example > 0b19 ERROR > > I'm not exactly sure how to specify this, but it is often important to > document what is not allowed along with what is allowed. I definitely agree that we need some e

Re: Perl 6 Test Organization

2002-11-20 Thread Dave Whipp
I wrote: >I think that it'd also be nice to get some consensus on which format of > test we should maintain: the table version, or the raw-code version. "Joseph F. Ryan" wrote: > I think the consensus when Chromatic brought the subject > up was to use the testing system that Parrot uses; however,

Re: Perl 6 Test Organization

2002-11-20 Thread Dave Whipp
"Tanton Gibbs" <[EMAIL PROTECTED]> wrote: > So, we can either use one generic test script, and write the perl6 > ourselves...or > we can create N specific test scripts which generate the perl6 for us given > a particular data set and after we have written the perl6 ourselves. Sounds > like duplicat

Re: Perl 6 Test Organization

2002-11-21 Thread Dave Whipp
"Chromatic" <[EMAIL PROTECTED]> asked: > Where would you like to generate the test files? Would it be part of the > standard 'make' target? Would it happen at the start of 'make test'? Would we > do it before checking the test files into source control? My usual approach is to checkin the genera

Re: Help! Strings -> Numbers

2002-11-21 Thread Dave Whipp
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote : > > 1) "Formats" as classes. What I _want_ to do is to be able to > associate a named "format" with a given class/instance/output, because > I tend to use the same few formats over and over. So if I want to > frequently output numbers as '%-4.2d', I j

Re: Status Summary; next steps

2002-11-25 Thread Dave Whipp
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote: > [...] and a type that matches every > context (except void). Actually, it might be nice to have a void type. It might seem useless: but then, so does /dev/null. An example, from another language, is C++ templates. Its amazing how often I find myself

Re: Syntax of using Perl5 modules?

2005-05-25 Thread Dave Whipp
Autrijus Tang wrote: So, this now works in Pugs with (with a "env PUGS_EMBED=perl5" build): use Digest--perl5; my $cxt = Digest.SHA1; $cxt.add('Pugs!'); # This prints: 66db83c4c3953949a30563141f08a848c4202f7f say $cxt.hexdigest; This includes the "Digest.pm" from Perl 5.

Re: reduce metaoperator on an empty list

2005-05-31 Thread Dave Whipp
Damian Conway wrote: 0 args: fail (i.e. thrown or unthrown exception depending on use fatal) ... $sum = ([+] @values err 0); $prod = ([*] @values err 1); $prob = ([*] @probs err 0); Just wanted to check, if I've said "use fatal": will that "err 0" DWIM, or will the fatal

Re: reduce metaoperator on an empty list

2005-05-31 Thread Dave Whipp
Damian Conway wrote: And what you'd need to write would be: $sum = (try{ [+] @values } err 0); The "err ..." idiom seems too useful to have it break in this case. Afterall, the purpose of "err 0" is to tell the stupid computer that I know what to do with the empty-array scenario. Feel

Re: reduce metaoperator on an empty list

2005-06-01 Thread Dave Whipp
Luke Palmer wrote: For something like: $ordered = [<] @array; If @array is empty, is $ordered supposed to be true or false? It certainly shouldn't be anything but those two, because < is a boolean operator. I have no problem with 3-state logic systems (true, false, undef) if this is w

Re: sub my_zip (...?) {}

2005-06-16 Thread Dave Whipp
Larry Wall wrote: You must specify @foo[[;[EMAIL PROTECTED] or @foo[()] <== @bar to get the special mark. I'm uncomfortable with the specific syntax of @a[()] because generated code might sometimes want to generate an empty list, and special-casing that sort of thing is always a pain (and f

Re: Time::Local

2005-07-05 Thread Dave Whipp
Larry Wall wrote: The time function always returns the time in floating point. I don't understand why time() should return a numeric value at all. Surely it should return a DateTime (or Time) object. Using epochs in a high level language seems like a really bad thing to be doing. If I want

Re: Time::Local

2005-07-05 Thread Dave Whipp
Douglas P. McNutt wrote: At 10:55 -0700 7/5/05, Dave Whipp wrote: I don't understand why time() should return a numeric value at all. Some of us like to use epoch time, as an integer, to create unique file names which sort "right" in a shell or GUI. You can use "

Re: Time::Local

2005-07-05 Thread Dave Whipp
Darren Duncan wrote: The object should not store anything other than this single numerical value internally (smart caching of conversions aside). I think we can all either agree with that, or dont-care it. The internal implementation is an implementation issue (or library). It doesn't need t

Re: Time::Local -- and lexical scope

2005-07-05 Thread Dave Whipp
Dave Whipp wrote: You can use "{time - $epoch}" or "{time.as<%d>}" or "{int time}". (That last one is not "{+time}", because that would be a floating-point value, not an integer). I was thinking: an epoch is just a time, and "int time

Re: File.seek() interface

2005-07-07 Thread Dave Whipp
Wolverian wrote: Or maybe we don't need such an adverb at all, and instead use $fh.seek($fh.end - 10); I'm a pretty high level guy, so I don't know about the performance implications of that. Maybe we want to keep seek() low level, anyway. Any thoughts/decisions? We should approach thi

Re: Hackathon notes

2005-07-08 Thread Dave Whipp
Rod Adams wrote: multi method foo#bar (Num x) {...} multi method foo#fiz (String x) {...} $y = 42; $obj.foo#fiz($y); # even though $y looks like a Num $obj.foo($z); # let MMD sort it out. Having additional tags might also give us something to hang priority traits off: "fo

Re: Perl 6 Summary for 2005-07-05 through 2005-07-12

2005-07-13 Thread Dave Whipp
Damian Conway wrote: Important qualification: Within a method or submethod, C<.method> only works when C<$_ =:= > $?SELF>. C<.method> is perfectly legal on *any* topic anywhere that $?SELF doesn't exist. Just to be clear, this includes any method/submethod with an explicitly named invo

Re: Optimization pipeline

2005-07-14 Thread Dave Whipp
Yuval Kogman wrote: - optimizers stack on top of each other - the output of each one is executable - optimizers work in a coroutine, and are preemptable - optimizers are small - optimizers operate with a certain section of code in mind > ... Optimizers

Re: Referring to package variables in the default namespace in p6

2005-07-21 Thread Dave Whipp
"TSa (Thomas Sandlaß)" wrote: Here your expectations might be disappointed, sorry. The non-symbolic form $*Main::foo = 'bar' creates code that makes sure that the lhs results in a proper scalar container. The symbolic form might not be so nice and return undef! Then undef = 'bar' of course let'

Re: Messing with the type heirarchy

2005-07-31 Thread Dave Whipp
Luke Palmer wrote: Everything that is a Num is a Complex right? Not according to Liskov But this is one of the standard OO >>paradoxes, and we're hoping roles are the way out of it. Well, everything that is a Num is a Complex in a value-typed world, which Num and Complex are in. I do

"set" questions -- Re: $object.meta.isa(?) redux

2005-08-10 Thread Dave Whipp
Luke Palmer wrote: A new development in perl 6 land that will make some folks very happy. There is now a Set role. Among its operations are (including parentheses): (+) Union (*) Intersection (-) Difference (<=) Subset (<) Proper subset (>=) Superset (>)

Re: Demagicalizing pairs

2005-08-24 Thread Dave Whipp
I've been trying to thing about how to make this read right without too much line noise. I think Lukes keyword approach ("named") is on the right track. If we want named params at both start and end, then its bound to be a bit confusing. But perhaps we can say that they're always at the end --

Parsing indent-sensitive languages

2005-09-08 Thread Dave Whipp
If I want to parse a language that is sensitive to whitespace indentation (e.g. Python, Haskell), how do I do it using P6 rules/grammars? The way I'd usually handle it is to have a lexer that examines leading whitespace and converts it into "indent" and "unindent" tokens. The grammer can then

Re: Parsing indent-sensitive languages

2005-09-08 Thread Dave Whipp
Damian Conway wrote: Alternatively, you could define separate rules for the three cases: { state @indents = 0; rule indent { ^^ $:=(\h*) { $ = expand_tabs($).chars } <( $ > @indents[-1] )> { let @indents = (@indents, $) }

Re: skippable arguments in for loops

2005-09-29 Thread Dave Whipp
Luke Palmer wrote: Joked? Every other language that has pattern matching signatures that I know of (that is, ML family and Prolog) uses _. Why should we break that? IMO, it's immediately obvious what it means. Something tells me that in signature unification, "undef" means "this has to be un

Look-ahead arguments in for loops

2005-09-29 Thread Dave Whipp
Imagine you're writing an implementation of the unix "uniq" function: my $prev; for grep {defined} @in -> $x { print $x unless defined $prev && $x eq $prev; $prev = $x; } This feels clumsy. $prev seems to get in the way of what I'm trying to say. Could we imbue optional b

Re: Look-ahead arguments in for loops

2005-09-30 Thread Dave Whipp
Damian Conway wrote: Rather than addition Yet Another Feature, what's wrong with just using: for @list ¥ @list[1...] -> $curr, $next { ... } ??? There's nothing particularly wrong with it -- just as ther's nothing particularly wrong with any number of other "we don't need thi

Re: Exceptuations

2005-10-05 Thread Dave Whipp
Luke Palmer wrote: Of course, exactly how this "public interface" is declared is quite undefined. Reading this thread, I find myself wondering how a resumable exception differs from a dynamically scropted function. Imagine this code: sub FileNotWriteable( Str $filename ) { die "can't write

Re: zip: stop when and where?

2005-10-06 Thread Dave Whipp
Luke Palmer wrote: zip :: [a] -> [b] -> [(a,b)] It *has* to stop at the shortest one, because it has no idea how to create a "b" unless I tell it one. If it took the longest, the signature would have looked like: zip :: [a] -> [b] -> [(Maybe a, Maybe b)] Anyway, that's just more of t

$value but lexically ...

2005-10-06 Thread Dave Whipp
C properties get attached to a value, and are available when the value is passed to other functions/ etc. I would like to be able to define a property of a value that is trapped in the lexical scope where it is defined. The example that set me thinking down this path is sub foo( $a, ?$b = rand

Re: Sane (less insane) pair semantics

2005-10-10 Thread Dave Whipp
Austin Hastings wrote: How about "perl should DWIM"? In this case, I'm with Juerd: splat should pretend that my array is a series of args. So if I say: foo [EMAIL PROTECTED]; or if I say: foo([EMAIL PROTECTED]); I still mean the same thing: shuck the array and get those args out here, even

Re: Proposal to make class method non-inheritable

2005-10-11 Thread Dave Whipp
Stevan Little wrote: I would like to propose that class methods do not get inherited along normal class lines. One of the things that has annoyed me with Java is that it's class methods don't inherit (dispatch polymorphically). This means that you can't apply the "template method" pattern to

Re: Proposal to make class method non-inheritable

2005-10-11 Thread Dave Whipp
Stevan Little wrote: David, ... If you would please give a real-world-useful example of this usage of class-methods, I am sure I could show you, what I believe, is a better approach that does not use class methods. ... The example I've wanted to code in Java is along the lines of: public

Thoughs on Theory.pm

2005-10-13 Thread Dave Whipp
(ref: http://svn.openfoundry.org/pugs/docs/notes/theory.pod) >theory Ring{::R} { >multi infix:<+> (R, R --> R) {...} >multi prefix:<-> (R --> R){...} >multi infix:<-> (R $x, R $y --> R) { $x + (-$y) } >multi infix:<*> (R, R --> R) {...} ># on

Re: Thoughs on Theory.pm

2005-10-13 Thread Dave Whipp
David Storrs wrote: While I like the idea, I would point out that 1000 tests with randomly generated data are far less useful than 5 tests chosen to hit boundary conditions. I come from a hardware verification background. The trend in this industry is driven from the fact that the computer

Re: Standard library for perl6? (graphical primitives)

2005-10-18 Thread Dave Whipp
Markus Laire wrote: I'm not completely sure if it would be worth the trouble to support only most primitive graphical commands "in core", (no windows, etc..), and leave the rest to the modules (or to the programmer). To a large extent, I'd want to leave most details to modules, etc. But what

Re: new sigil

2005-10-21 Thread Dave Whipp
Luke Palmer wrote: As I mentioned earlier, most programmers in a corporate environment >> have limited access to system settings. And in those kinds of corporate environments, you're not going to be working with any code but code written in-house. Which means that nobody is going to be using L

Re: Status Summary; next steps

2002-11-26 Thread Dave Whipp
"Larry Wall" <[EMAIL PROTECTED]> wrote: > On Mon, Nov 25, 2002 at 07:46:57PM -0500, Bryan C. Warnock wrote: > : Should an explicit bool type be part of the language? If so, how should > : it work? C storing only a truth property but > : no value makes little sense in the context of the larger lang

Re: Status Summary; next steps

2002-11-26 Thread Dave Whipp
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote > I'm trying to think of a counterexample, in which you have a context > that _cannot_ be represented as a "type" according to this very broad > definition. I don't think it should be possible, is it? If it _is_ > possible, does that represent a flaw/li

Re: Numeric literals, take 3

2002-11-27 Thread Dave Whipp
"Angel Faus" <[EMAIL PROTECTED]> wrote: > Alphanumeric digits: Following the common practice, > perl will interpret the A letter as the digit 10, the B > letter as digit 11, and so on. Alphanumeric digits are case > insensitive: > > 16#1E3A7 # base 16 > 16:1e3a5 # the

Re: Numeric literals, take 3

2002-11-27 Thread Dave Whipp
"Luke Palmer" <[EMAIL PROTECTED]> wrote > > This notation is designed to let you write very large or > > very small numbers efficiently. The left portion of the > > C is the coefficient, and the right is the exponent, > > so a number of the form C is actually intepreted > > as C. > > Your "coeffic

Indenting HERE docs

2002-12-02 Thread Dave Whipp
At various times, I have seen proposals for using indentation with HERE docs. Was this issue ever resolved? Dave.

  1   2   3   4   >