Re: Usage of \[oxdb] (was Re: String Literals, take 2)

2002-12-04 Thread Dave Whipp
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote > Note that \b conflicts with backspace. I'd rather keep backspace than > binary, personally; I have yet to feel the need to call out a char in > binary. :-) Or we can make it dependent on the trailing digits, or > require the brackets, or require back

Re: purge: opposite of grep

2002-12-05 Thread Dave Whipp
"Larry Wall" <[EMAIL PROTECTED]> wrote: > On Thu, Dec 05, 2002 at 10:09:08AM -0800, Michael Lazzaro wrote: > : What about "divvy" (or are we already using that for something else?) > : > : my(@a,@b) = divvy { ... } @c; > > Any such solution must use := rather than =. I'd go as far as to say >

Re: purge: opposite of grep

2002-12-05 Thread Dave Whipp
"Miko O'Sullivan" <[EMAIL PROTECTED]> wrote: > On Thu, 5 Dec 2002, Dave Whipp wrote: > > > Only if we apply a bit of magic (2 is a true value). The rule might be: > > How about if we just have two different methods: one for boolean and one > f

Re: purge: opposite of grep

2002-12-06 Thread Dave Whipp
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote > > Some of those might be appropriate (or just amusing). :-) I still like partition (or simply C). Segregate (c) might also work I notice everyone still want Int context for eval of the block: Pease don't forget about hashes. Is there such a thing as

Re: right-to-left pipelines

2002-12-09 Thread Dave Whipp
Stéphane Payrard wrote: I would like perl6 to support left-to-right part/sort/grep pipelines. Left to right syntax is generally good because it facilitates the flow of reading. [cut] Tentative syntax: ... is an left-associative operator that has the same precedence as . [cut] example: @dat

Re: Comparing Object Identity (was: Re: Stringification of references (Decision, Please?))

2002-12-11 Thread Dave Whipp
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote: > After thinking about it a little more, I'll set myself on the "yes" > side. And propose either '===' or ':=:' to do it. Definitely '==='. This is used in various other languages. > >$obj1 eq $obj2;# [1] are their stringifications identical?

Re: Everything is an object.

2002-12-11 Thread Dave Whipp
"Michael G Schwern" <[EMAIL PROTECTED]> wrote: > This is just your friendly neighborhood curmudgeon reminding you that in > Perl 6, everything is an object > ... > Instead of introducing new built-in functions they can be done as methods. The problem with this worldview is that you end up with hor

Re: Everything is an object.

2002-12-11 Thread Dave Whipp
"Simon Cozens" <[EMAIL PROTECTED]> wrote > Verbs are almost always associated with their subject in OO languages, > so I don't see where you're coming from. Actually, the important part of it was the 3rd option (the multimethod): sometimes the association is symmetrical. I was pointing out that t

Re: Comparing Object Identity

2002-12-12 Thread Dave Whipp
"John Siracusa" <[EMAIL PROTECTED]> wrote: > memory addresses is so infrequent that warrants a much > less common and/or longer method name than "id". Another reason for not making these synonymous: Is the address of an object constant? Or might it be remapped during the life of an object. For ex

Re: Comparing Object Identity

2002-12-12 Thread Dave Whipp
"Brent Dax" <[EMAIL PROTECTED]> wrote in message 00f901c2a22a$50417b30$6501a8c0@deepblue">news:00f901c2a22a$50417b30$6501a8c0@deepblue... > Under all systems I can think of, the memory address of an object's > header is constant. The data may move, but the header stays constant. > This is to minim

Re: Comparing Object Identity

2002-12-12 Thread Dave Whipp
"Dan Sugalski" <[EMAIL PROTECTED]> wrote in message news:a05200f00ba1ebb73c6d2@[63.120.19.221]... > There'll definitely be memory address reuse. If .id returns the > current object's memory address, it shouldn't be cached any place, as > otherwise you'll find things going bang with some regularity.

Re: Comparing Object Identity

2002-12-16 Thread Dave Whipp
"Piers Cawley" <[EMAIL PROTECTED]> wrote : > I found myself mulling over: > > $obj.is($other_obj); > > Which seems to work reasonably well, and I'd be rather surprised if > it clashed with anything with different semantics... My only problem with it is the lack of symmetry. Is there any reason

Re: Comparing Object Identity

2002-12-16 Thread Dave Whipp
"Piers Cawley" <[EMAIL PROTECTED]> wrote : > > $a eq : ID $b # yes, I would want to generalize that > > I started off thinking 'well, you could just define an 'is' operator' > and then realised we already have one. Hmm. Personally i don't have a > problem with not having an operator for this par

Adverbs and Numeric Literals

2002-12-17 Thread Dave Whipp
A3/E3 introduce adverbs using the colon operator. An example given is as a "step" for the range operator: 0..Inf : 2 How is the ambiguity with literals resolved? What is the output of print 0..3#2:2 ? 012345678 or 02 Is it whitespace sensitive? What about "0..3#12:2"? Dave.

Re: tree frobbing facilities in Perl6?

2002-12-24 Thread Dave Whipp
Rich Morin wrote: is not something I want to try in XSLT. I can do it in Perl, of course, but I end up writing a lot of code. Am I missing something? And, to bring the posting back on topic, will Perl6 bring anything new to the campfire? I think that one of the things that Perl6 will bring is

Variable Types Vs Value Types

2003-01-03 Thread Dave Whipp
Can the type of a variable vary independenty of its value? Consider the following: my @a = (1,2,3); my $b := @a; @a and $b both refer to the same object. $b's object has methods such as PUSH, POP, etc, as does @a's. So the type of the value (object) is the same in each case, but the vari

Re: Variable Types Vs Value Types

2003-01-05 Thread Dave Whipp
John Williams wrote: Do they? One is obviously an array, and one is obviously a scalar. You may get an error (cannot alias an array as a scalar) or $b get aliased to the array-in-scalar-context (a reference). This is one of those "how we think about the fundamentals" things. I am taking the v

Re: Variable Types Vs Value Types

2003-01-07 Thread Dave Whipp
"Piers Cawley" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Dan Sugalski <[EMAIL PROTECTED]> writes: > > An object is a data type, as much as an array or hash is a data type, > > but that doesn't make an array an object. [insert obligatory "all men > > are Soc

Re: Variable Types Vs Value Types

2003-01-07 Thread Dave Whipp
--- Michael Lazzaro <[EMAIL PROTECTED]> wrote: > These lines all declare @a to be an array that stores ints. That > would imply that the "is Array" part is actually instantiating > (Cing) the array... you're not saying that @a "can someday > hold an array obj", you're saying it already _is_ an arr

Re: L2R/R2L syntax (was Re: Everything is an object.)

2003-01-08 Thread Dave Whipp
"Buddha Buck" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > and similarly, > > $a <~ ...; > > is equivalent to > > $a = ...; But with the different precedence. At last, I can assign from a list without using parentheses: @a = 1, 2, 3; # newbie error @a <~

Re: L2R/R2L syntax

2003-01-17 Thread Dave Whipp
"Mr. Nobody" <[EMAIL PROTECTED]> wrote : > I have to wonder how many people actually like this syntax, and how many only > say they do because it's Damian Conway who proposed it. And map/grep aren't > "specialized syntax", you could do the same thing with a sub with a prototype > of (&block, *@list

Re: L2R/R2L syntax

2003-01-18 Thread Dave Whipp
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > And note that as pretty as -> is, we couldn't have <- for piping > because it would conflict rather strongly things like > > if ($a<-5)# (negative five, or pipelike?) Its resolved by the "

C as a "junction" operator

2003-01-18 Thread Dave Whipp
In the L2R thread, I made a comment where I contrasted a for loop with a junction. On reflection, I think we could go further. If we defined my $prev = 0; sub mangle($value) { $value + $prev; $prev=$value } and then used it as: my $x = any(1,2,3); $y = mangle($x); then the semant

Re: C as a "junction" operator

2003-01-20 Thread Dave Whipp
Damian Conway wrote: > Yes, but will it junctify them con-, dis-, ab-, or in-junctively??? Probably most similar to injunctively. But sequentially. I had been thinking of something like this: while () { print "matched $_" if $_ == for(1,2,3,4,5); } __DATA__ 1 2 9 3 4 5 Like the old bistable

Re: A proposal on if and else

2003-01-21 Thread Dave Whipp
"Joseph F. Ryan" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Rafael Garcia-Suarez wrote: > > > >The tokeniser could send two tokens "else" and "if" whenever it > >recognizes the keyword "elsif" -- so this isn't a problem. > > > > I think the point of having

Re: Why C needs work (was Re: L2R/R2L syntax)

2003-01-22 Thread Dave Whipp
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Of course, _I'd_ even prefer using <- and -> as the 'piping' operators, > and having ~> or |> for pointy sub, because then $a->foo and $a.foo > really _could_ be the same thing, 'cept for precedenc

Re: Why C needs work (was Re: L2R/R2L syntax)

2003-01-22 Thread Dave Whipp
"David Storrs" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > And then we can replace the ~> with ->: > > > > for 1,2,3,4 > > -> sub ($a, $b) { $a+$b } > > -> sub ($a) { $a**2 } > > -> { $^foo - 1 } > > -> print; > > > > And this begs the que

Re: More Array Behaviors

2003-01-27 Thread Dave Whipp
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... >... if such capabilities exist, what are their real names? Can > anyone think of any that are absolute must-haves? Are any of the above > must-haves? I think that the only must-have is the a

Re: More Array Behaviors

2003-01-27 Thread Dave Whipp
"Damian Conway" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Dave Whipp suggested: > > > The size constraints are probably C properties, as is C. The > > exception behavior probably deserves to remain an C prope

Re: More Array Behaviors

2003-01-27 Thread Dave Whipp
"Damian Conway" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... >Anything that "holds" anything is a variable, not a value. > [...] > I'm saying that only scalar *values* can have C properties. > And yes, that includes Array references, but not arrays. > > > My men

Re: Arrays: Default Values

2003-01-28 Thread Dave Whipp
Michael Lazzaro wrote: 2a) When a cell is explicitly re-undefined, does the default value take effect? my @a is Array( default => 'foo' ) = (1,2,3); @a[1] = undef; @a[1]; # undef, or 'foo'? STRAWMAN ANSWER: 'foo'. If C is a valid value for a cell, then I should be able

Re: Arrays: Default Values

2003-01-28 Thread Dave Whipp
Aaron Sherman wrote: auto-vivification will have to happen in some cases. e.g. if foo requires a lvalue parameter. You can't know if an actual write will happen, so you have to auto-vivify in order to pass a reference. Or did I miss something there? I think the idea is to use a special object

Re: Arrays: Default Values

2003-01-29 Thread Dave Whipp
"Jonathan Scott Duff" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On Wed, Jan 29, 2003 at 11:32:53AM -0800, Michael Lazzaro wrote: > > > > Agreed, it's not pretty. The fundamental problem is that a primitive > > like an C simply cannot be undefined... there'

Re: Arrays vs. Lists

2003-02-07 Thread Dave Whipp
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Along those lines, the closest I've been able to come so far to a > usable two-sentence definition is: > > -- A list is an ordered set of scalar values. quibble: that's an "ordered bag", isn't it?

Re: Arrays vs. Lists

2003-02-11 Thread Dave Whipp
"Mark J. Reed" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > On 2003-02-11 at 17:44:08, Mark J. Reed wrote: > > pop @{[@a,@b,@c]} > > > > It creates an anonymous array, then removes the last element, leaving two > > elements in the array - which is i

Re: Arrays vs. Lists

2003-02-11 Thread Dave Whipp
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > What is the utility of the perl5 behavior: > > \($a,$b,$c) > > meaning > > (\$a, \$b, \$c) > > Do people really do that? I must say, given that it looks *so > obviously* like it instead

Re: Object spec, try 2

2003-03-03 Thread Dave Whipp
Dan Sugalski wrote: Okay, here's another shot at the semantics for objects. If folks, especially non-perl folks, would look this over and chime in, I'd much appreciate it. The thing that I noticed was the lack of semantics for creation and destruction. Will there be well defined creation semanti

Re: Object spec

2003-03-06 Thread Dave Whipp
Sam Vilain wrote: Associations *are* fundamental object things. Presenting them in terms of attributes is the real hack. I agree with this statement; and Brent previously asked what associations *are*. The problem with describing them in terms of attributes/properties not not so much that its a

Re: A6: Complex Parameter Types

2003-03-10 Thread Dave Whipp
Larry Wall wrote: I dunno. I can argue that it should coerce that. It'll certainly be able to coerce a random scalar to int for you, so it's not a big stretch to coerce conformant arrays of them. On the other hand, it's likely to be expensive in some cases, which isn't so much of an issue for s

Re: A6: macro invocants

2003-03-12 Thread Dave Whipp
Larry Wall replied: : my Database $db = MySqlDatabase.connect(...); : $db.select * FROM Foo WHERE Foo.bar LIKE a%b; To answer your actual question, you either need to have some keyword out front to start the alternate parsing, or you need to treat ".select" as an infix macro that has an ordina

A6: macro invocants

2003-03-11 Thread Dave Whipp
The effect of a macro is lexical; but "the name may be installed in either a package or a lexical scope". If the name is installed in a class, can it be invoked via a variable of that class? Example (SQL query integrated via macro): my Database $db = MySqlDatabase.connect(...); $db.select *

Re: a thought on multiple properties

2003-03-13 Thread Dave Whipp
Michael Lazzaro wrote: Defining a Class for this is also overkill. Ye.. well, no. Why? class Foo is Bar; # normal inheritance class Baz is Bar; # the thing that we are over-killing Foo.isa("Baz") == FALSE; A lightweight, typedef-like mechanism behaves differently: class Foo is Bar; ty

Re: A6: macro invocants

2003-03-12 Thread Dave Whipp
Luke Palmer wrote: Well, if you did that, it surely couldn't be polymorphic, which kind of defeats most of the purpose of making it a method. I disagree. Consider the "template method" patten. This uses a non-polymorphic method in a base class to invoke a set of polymorphic methods in a standar

Re: A6: macro invocants

2003-03-12 Thread Dave Whipp
Luke Palmer wrote: I'm not quite sure I follow you (I'm not familiar with that pattern). But the macromethod I imagine is the non-polymorphic one, and the one it expands to is the polymorphic one, if I'm guessing correctly. And you certianly could do that. yes: http://patterndigest.com/patterns/Te

Re: A6: macro invocants

2003-03-12 Thread Dave Whipp
Brent Dax wrote: Dave Whipp: # But you're right, there are situations where the (base) type # might not # be knowable: and these could result in syntax errors. Except they wouldn't, at least not always. [snip] The only part of that I'm not sure about is infix:LIKE, since such an

Re: [SUMMARY] A6: Type Inference (was Re: A6: Strict signature checking)

2003-03-14 Thread Dave Whipp
Michael Lazzaro wrote: 3) If an "untyped" var is used for a typed parameter, a simple dataflow analysis is used to determine whether the compiler can guarantee that, at that point, an "untyped" var will _always_ contain values of a known, specific type. If so, the type is inferred (silently or

Re: A6: Strict signature checking - was: Complex Parameter Types

2003-03-13 Thread Dave Whipp
Damian Conway wrote: b) The argument passed here must be something that will definitely not cause the program to crash and burn, and we'll verify that at compile-time. I'm arguing that the former is well-nigh useless, and that the latter is what large systems developers and

Re: is static?

2003-03-15 Thread Dave Whipp
Uri Guttman wrote: talking about nested subs brought up another related idea, static (not on the stack) lexicals inside subs. Doesn't C give you this? Dave. -- http://dave.whipp.name

Re: A6: Complex Parameter Types

2003-03-17 Thread Dave Whipp
class Scalar isa intlike, numlike, ...; # and isa Object or whatever Qoting A6: "Perl makes a distinction between the type of the variable, and the type of the value" If we view Scalar as the type of a variable, not value, then we could cease to need all this cleverness with inheritance. Peopl

Re: Short-circuiting user-defined operators

2003-04-01 Thread Dave Whipp
Joe Gottman wrote: Alternatively, there might be a new parameter type that indicates that the parameter is not evaluated immediately: sub infix:!! ($lsh, $rhs is deferred) {...} A nice concept! So nice, in fact, that it would be a shame to limit it to function args. I could see myself writing:

Re: == vs. eq

2003-04-01 Thread Dave Whipp
Luke Palmer wrote: Ooh! And I came up with a good identity operator! :== (or =:= if you like symmetry). There's a beautiful parallel with := . $a = $b; $a == $b; # is always true $a := $b; $a :== $b; # is always true ($a =:= $b; # looks a little better) While we're rehashi

Re: Conditional Cs?

2003-04-02 Thread Dave Whipp
Reading A6, I was wondering if the following would work: sub return_if_true ($value) { if ($value) { leave where=>caller(1), value=>$value } }

Re: Short-circuiting user-defined operators

2003-04-03 Thread Dave Whipp
Joe Gottman wrote: There are two reasonable semantics for deferred parameters: 1) lazy evaluation with caching, where the evaluation of the actual expression in the call is deferred until the sub actauly makes use of it and the result is then cached and reused as necessary. Any side effects happ

Re: Cothreads [was Re: Coroutines]

2003-05-27 Thread Dave Whipp
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote > Similarly, then, I would expect: > > sub foo(...) is threaded { ... yield() ... return() } > > foo(...args...) > > to start &foo as a new thread. Perhaps we should fall back on the old message passing abstraction, where messages can be either

Re: Cothreads

2003-05-27 Thread Dave Whipp
A few more random thoughts: Austin proposed { thread { print "hello\n" }; print "world"; } would spawn the first print into a separate thread, and then join before executing the second print. I would like to see if this can be extended a bit, using Luke's "object Sigil" proposal: my $resu

Re: Cothreads

2003-05-27 Thread Dave Whipp
"John Macdonald" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I would like to suggest a radically different > mechanism, that there be operators: fork, tfork, and > cfork to split off a process, thread, or coroutine > respectively. (The first might be called pfork > if we're will

Re: Cothreads [was Re: Coroutines]

2003-05-27 Thread Dave Whipp
Jonathan Scott Duff wrote: I've read this post far more times than I care to admit and I still see no merit to conflating "threads" and "coroutines". To me, the salient feature of coroutines is the ability to start from the beginning or from where we left off, while the salient feature of threads

Re: Cothreads

2003-05-29 Thread Dave Whipp
"Jonathan Scott Duff" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > If we could think about "threads" not in terms of forkyness, but simply > > in terms of coroutines that can be called in parallel, it should be > > possible to create an implementation of "threading" that had to

Re: Cothreads [Philosophy]

2003-05-29 Thread Dave Whipp
"Austin Hastings" <[EMAIL PROTECTED]> wrote: > 1. C always acts the same way -- stores args in CurThread.result > and gives up control to [?something?]. I think you want a fifo on the output there -- at least conceptually. "Stores args in .result" might overly block the producer thread. "gives up

Re: Cothreads [Philosophy]

2003-05-29 Thread Dave Whipp
"Austin Hastings" <[EMAIL PROTECTED]> wrote > --- Dave Whipp <[EMAIL PROTECTED]> wrote: > > "Austin Hastings" <[EMAIL PROTECTED]> wrote: > > > 1. C always acts the same way -- stores args in > > CurThread.result > > > and gi

Re: Cothreads [Philosophy]

2003-05-29 Thread Dave Whipp
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote in > for {...} > > It doesn't matter whether foo() is a closure or function returning a > list, lazy list, or iterator, or is a coroutine returning it's .next > value. Which is excellent, and, I'd argue, the whole point; I'm not > sure that we can

Threads and Progress Monitors

2003-05-30 Thread Dave Whipp
OK, we've beaten the producer/consumer thread/coro model to death. Here's a different use of threads: how simple can we make this in P6: sub slow_func { my $percent_done = 0; my $tid = thread { slow_func_imp( \$percent_done ) }; thread { status_monitor($percent_do

Re: Threads and Progress Monitors

2003-05-30 Thread Dave Whipp
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote in> # But if you want to get the thread object, so you can monitor it's > { > ... > my $tid = thread &slow_func_impl(...); > while $tid.active { > status_monitor($tid.progress); > sleep 60; >

Re: Threads and Progress Monitors

2003-05-30 Thread Dave Whipp
"John Macdonald" <[EMAIL PROTECTED]> wrote > At first glance, this doesn't need a thread - a > Instead of > sleep, though, I'd use a pipeline and read it with > a non-blocking read until there is no data. ... ++ For the lateral thinking. Definitely a valid solution to the problem, as given. So I

Re: Threads and Progress Monitors

2003-05-30 Thread Dave Whipp
"Luke Palmer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > my $result is lazy::threaded := { slow_fn_imp @_ }; > loop { > timeout(60); > return $result; > CATCH { > when Timeout { print "...$(time)\n" > } > } > > Now write the

Re: Threads and Progress Monitors

2003-05-30 Thread Dave Whipp
Dulcimer wrote: sub slow_fn { my $tick = Timer.new(60, { print "..." }); return slow_fn_imp @_; } Now if I could just get the compiler to not complain about that unused variable... Maybe I'm being dense Why not just sub slow_fn { Timer.new(1, { print "." }); return slow_fn_imp @_;

Re: interthread signaling

2003-06-03 Thread Dave Whipp
Luke Palmer wrote: I think it would fall trivially out of the events mechanism, which is planned for Parrot. I have heard rumours of such a thing, but no details of how it will be exposed in the language... Dave.

Timers (was Threads and Progress Monitors)

2003-05-31 Thread Dave Whipp
"Dulcimer" <[EMAIL PROTECTED]> wrote > so that the timer goes off after a second, prints a dot, and resets > itself to go off again after another second? And I still like the idea > of an expanding temporal window between dots: > > sub slow_fn { > my $pause = 1; > my $timer is last { .sto

Re: Timers (was Threads and Progress Monitors)

2003-05-31 Thread Dave Whipp
"Dulcimer" <[EMAIL PROTECTED]> wrote > > But exposing the object like that still bothers be: I shouldn't need > > the $tmp, nor the .new. > > I'm not so sure I agree with losing the new(). I kinda like that just > for readability. Less isn't always more. :) > > Ok, how about this: > > sub slow_fn

Re: Timers (was Threads and Progress Monitors)

2003-05-31 Thread Dave Whipp
"Dulcimer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I find C too terse, and would > rather see a more verbose version I'm obviously more lazy than you ;-). > Ah. Ok, but if that's the case, you could as easily write it > >timeout(5) { coro { ... } }; > > and have the com

Re: MMD [was Re: This week's summary]

2003-06-09 Thread Dave Whipp
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote > multi bar (Foo $self, int $i : ); # semicolon optional I think you meant "colon optional". The semi-colon is, I think, a syntax error. You need the yada-yada-yada thing: "{...}". But I agree with the main point you were wanting to make

interthread signaling

2003-06-03 Thread Dave Whipp
"Piers Cawley" <[EMAIL PROTECTED]> wrote > Threads and Progress Monitors > Dave Whipp had some more thread questions, and wondered what would be a > good Perl 6ish way of implementing a threaded progress monitor. Whilst > the discussion of all this was in

Re: multi stack question/grumble

2003-06-27 Thread Dave Whipp
"Matt Fowles" <[EMAIL PROTECTED]> > Were this C++ I would say that we could write a single general purpose > stack and use template meta-programming to avoid the overhead. Is there > a similar solution available in C? > > My instincts tell me that this solution will be dirty to the tune of > massi

Re: Exceptions

2003-06-27 Thread Dave Whipp
Luke Palmer wrote: So, maybe what's needed is a C catcher (C... eew), where C would throw an exception object with an attached continuation. And of course, if a warning reached the top of the stack without being caught, it would print itself and invoke its continuation. I thought I'd try and see

Re: [perl #22855] [PATCH] build imcc as parrot

2003-07-01 Thread Dave Whipp
"Andy Dougherty" <[EMAIL PROTECTED]> wrote: > The problem is that with a clean build tree, there are no *.o files > down in languages/imcc/ at the point when that target is reached. > Hence make doesn't have anything to expand *.o as, and quite reasonably > complains. If, however, there is even a

Parsers with Pre-processors

2003-07-17 Thread Dave Whipp
I've been re-reading A5 (regexen), and I was trying to work out how to incorporate a preprocessor into regex, without a separate lexer. I came to the conclusion that preprocessor commands are part of the whitespace in the higher layer of the grammer. So we just need to define the rule appropri

Re: Aliasing an array slice

2003-07-18 Thread Dave Whipp
"Luke Palmer" <[EMAIL PROTECTED]> wrote: > Benjamin Goldberg wrote: > > David Storrs wrote: > > > @a[1..3] = qw/ a b c d e /; > > > print @a; # 0 a b c d e 4 5 > > > > What would happen if I used 1,2,3 instead of 1..3? Would it do the same > > thing? > > Of course. I tend to agree, I

Re: The Perl 6 Summary -- preprocessors

2003-07-21 Thread Dave Whipp
"Piers Cawley" <[EMAIL PROTECTED]> wrote > Parsers with Pre-processors > I didn't quite understand what Dave Whipp was driving at when he talked > about overloading the "" pattern as a way of doing preprocessing of > Perl 6 patterns. I di

Re: The Perl 6 Summary -- preprocessors

2003-07-21 Thread Dave Whipp
"Austin Hastings" <[EMAIL PROTECTED]> wrote: > What you really want is to be able to "chain" grammars: > > > my $fh = open " > $fh =~ //; > > grammar Grammars::Languages::C { > method init { > SUPER::init; > > $.source = (new Grammars::Language::C::Preprocessor).open($source); > } > .

Re: The Perl 6 Summary -- preprocessors

2003-07-21 Thread Dave Whipp
"Austin Hastings" <[EMAIL PROTECTED]> > > I.e. is it just an input stream filter? > Doubtful. > > Do you want to do this at the grammar level, or the file level? > > If you want it at the file level, you C a translator (ooh! my > first p6 idiom!) to the file handle. > > If you want it at the gramma

E6: Small Junctions

2003-08-01 Thread Dave Whipp
In E6, Damian write: "A junction is a single scalar value that can act like two or more values at once". Whenever I see a statement like this, I tend ask myself "What happenned to zero and one?". Perhaps its intentional; perhaps its sloppy writing. What issues arise with junctions of 0 or 1 member

Re: E6: Small Junctions

2003-08-01 Thread Dave Whipp
"Mark J. Reed" <[EMAIL PROTECTED]> > Quick, dumb question: what is an "abjunction"? How does it differ > from a junction? An abjuction requires that none of its members match. For example, ($a == none(1,2,3)) is true for any value of $a except 1, 2 or 3. Dave.

Implicit parameter aliases

2003-08-06 Thread Dave Whipp
Are parameter names part of the function signature? A6 defines "siglets", which don't appear to include parameter names. If I write: sub foo( Int $a, Int $b ) {...} sub foo( Int $a, Int $c ) { print $a+$c } Are these now equivalent: foo( a => 1, b => 2 ) foo( a => 1, c => 3 ) What if I

Re: What the heck is: timely destruction

2003-08-19 Thread Dave Whipp
"Benjamin Goldberg" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > What we'd like is a way (and there've been a couple proposed) to make it > so that the sweep at the end of scope can *quickly* determine that all > objects needing timely destruction are still alive/reachabe/in-scope,

Re: [RFC] Dynamic PMC Classes

2003-08-14 Thread Dave Whipp
"Leopold Toetsch" <[EMAIL PROTECTED]> wrote > What about the following (also considering, that we might not like one > A dynamic PMC library has one init function returning a dyn_pmc_info > structure: In the past, I've found the "init-fn returns struct" model can become a burden when, in a few yea

Undeclared attributes

2004-12-10 Thread Dave Whipp
Attributes are declared with C, but also have a unique signil C<$.>. So is it strictly necessary to declare them? Or rather, is it Cly necessary -- i.e. is the following legal? no strict; class Foo { method bar { say $.a++ } }

Re: Dimension of slices; scalars versus 1-element arrays?

2005-01-11 Thread Dave Whipp
Larry Wall wrote: On Sat, Jan 08, 2005 at 11:37:06AM -0700, Craig DeForest wrote: : Is the perl6 expression : @a[4; 0..5]; : a 1x6 array (probably correct)? Or a 6 array (probably not correct)? Certainly the former. I don't think dimensions should ever disappear accidentally. Except when y

Re: Proposed vtable changes WRT method lookup

2005-01-17 Thread Dave Whipp
Leopold Toetsch wrote: 1) rename vtable->data to vtable->class All current usage of the 'void *data' vtable element is as the object's class. So it should read "PMC *class". Its a minor thing, but I would try to avoid using identifiers that are keywords in C++: especially in header files. The fact

Dynamically Scoped Dynamic Scopes

2005-02-27 Thread Dave Whipp
I was thinking about scopes (for a problem unrelated to Perl 6), and I realised that the scoping concepts in P6 are somewhat limited. We have my $var # lexical scope temp $var # lexically-scoped dynamic scope C is lexically scoped in that its effect goes away at the closing curly of the le

Adding linear interpolation to an array

2005-03-07 Thread Dave Whipp
I was trying to work out how to get non-integer indexes working for an array -- initially using linear interpolation, though perhaps later it would be generalized. Can anyone comment on whether this simple role would work as I expect. Does defining the invocant as "Num @self is constant" constr

Re: Adding linear interpolation to an array

2005-03-07 Thread Dave Whipp
Aldo Calpini wrote: I don't think you need "is constant". arguments are readonly by default, unless you give them the "is rw" trait. I guess that "is constant" means that you can specify the index only using a literal, not a variable, eg: @test[1]; # ok, 1 is a costant my $idx = 1; @

Re: Adding linear interpolation to an array

2005-03-08 Thread Dave Whipp
Thomas Sandlaß wrote: Or perhaps even sub foo (Num @in is copy does LinearInterpolation) { ... } This is my big questionmark on roles: is the above a contraint or merely a directive. In the former case only Arrays of Num that do LinearInterpolation are allowed, in the latter case every Array of

Re: Junctions - feedback and desires

2005-03-10 Thread Dave Whipp
Rod Adams wrote: I do not believe that you can create a 'lazy junction'. But I don't recall the topic coming up before, so we'll have to wait for Damian to come back unless someone else knows for certain. My understanding is that all lists are conceptually lazy. "any(2..Inf)" is perfectly valid.

Re: A possible solution for s?pintf

2005-03-12 Thread Dave Whipp
Larry Wall wrote: I don't see that this buys us anything over just shortening "sprintf" to something shorter, like: print as '%03d %15s', $foo, $bar; And your argument list falls out naturally from making "as" a listop. Plus it naturally lets you say other "as-ly" things: print as MyBigInt, $

Re: [perl #34420] TODO suggestion: clean Parrot's ABI

2005-03-14 Thread Dave Whipp
Matt Diephouse wrote: There's no real point in having a plan if you don't follow it, That sounds a bit naive. The benefit of a plan is primarily in the act of making it (it forces you to think about what you want to do). The secondary benefit comes when you track how actual progress deviates from

Re: eval (was Re: New S29 draft up)

2005-03-18 Thread Dave Whipp
Larry Wall wrote: On Fri, Mar 18, 2005 at 10:28:18AM -0500, Aaron Sherman wrote: : Thus: : : eval read :file("foo"); : : There you have it. The problem being that it will now report errors in some random temporary string rather than at some line number in a file. Not good. Orthogonality strike

Re: A sketch of the security model

2005-04-14 Thread Dave Whipp
Dan Sugalski wrote: All security is done on a per-interpreter basis. (really on a per-thread basis, but since we're one-thread per interpreter it's essentially the same thing) ... * Number of open files * IO operations/sec * IO operations total ... Can an "application" get more resources

Re: Unify cwd() [was: Re: $*CWD instead of chdir() and cwd()]

2005-04-16 Thread Dave Whipp
Chip Salzenberg wrote: As you know, under Unix, there's no such thing as "the current directory" as a string. The only durable current directory is the device and inode of C. It's not wise to conflate the current directory with a name that at some point in the past could have been used to reach i

statement modifiers for setting variables

2005-04-18 Thread Dave Whipp
The following is legal perl: print "$a $b $c" if ($a,$b,$c)=(1,2,3); This prints "1 2 3", but the definitions obviously aren't scoped to the modified statement. And a C in the modifier is a bit too late. Any reason to [not] add a C statement modifier which restricts the scope of the declaratio

Re: LABELS: block

2005-04-26 Thread Dave Whipp
Juerd wrote: ... Or just add quotes (yes, please) and keep the colon: "foo": for 1... { next "foo"; } Given that "next" throws a control-exception that is handled by the looping construct, perhaps we sohuld think of the label as an optional parameter to the looping statement funct

<    1   2   3   4   >