On 9/25/05, Yuval Kogman <[EMAIL PROTECTED]> wrote:
> > In order to enforce that level of compile-time type safely, you should
> > need to declare my Dog $dog, or stick a pragma up top:
>
> That's the point of my question - why? What do I lose by
> inferrencing?
Nothing that I see. I recant my arg
On 9/25/05, Luke Palmer <[EMAIL PROTECTED]> wrote:
> On 9/25/05, Juerd <[EMAIL PROTECTED]> wrote:
> > We can do better than equivalence testing for colors. Instead, try to
> > match. Surely a *smart* match operator really is smart?
> >
> > $color ~~ '#FF00FF'
> >==
> > $color ~~
This is pretty long as is, so I'm going to leave out all the things I
agree with.
On Fri, Sep 09, 2005 at 01:48:20PM +0200, Leopold Toetsch wrote:
> Chip writes:
> > * optional parameter interface: ":opt_count" -> ":opt_flag"
> > So ":opt_count" should be replaced with ":opt_flag", which set
On Sun, Sep 25, 2005 at 10:04:16AM -1000, Joshua Hoblitt wrote:
> * Expands the header to be 32 bytes in size.
OK
> * The magic number is no longer an opcode outside the header. It is
> now an 8 byte magic string at the the beginning of the header.
I should think four would do, but no m
In a private conversation with Larry this afternoon, he said that by
default "$foo" and ~$foo and $foo.as(Str) all give the same result
(assuming scalar context, etc.). And that "@foo[]" and [EMAIL PROTECTED] and
@foo.as(Str) are the same as join(' ', @foo) where join is effectively:
sub join
Whenever possible, object should have useful numeric and string
representations. These are generally lossy, but this is not a problem, because
a scalar stays a scalar even after being used in a certain context, and the
object isn't lost.
When a protocol or data format that already has a string for
On Sun, Sep 25, 2005 at 07:53:40PM -0400, Randy W. Sims wrote:
> I haven't tried overriding yet, but your mention of a change in
> internals reminds me of another approach I had tried without success.
> The docs imply in its psuedo perl version of C that I might be
> able to set $INC{'Foo.pm'} t
Michael G Schwern wrote:
On Sat, Sep 24, 2005 at 02:13:46PM -0400, Randy W. Sims wrote:
Is there a way to make C or C fail without manipulating
@INC or hiding the physical file? Or more generally, how do you test all
branches of constructs like:
if ( eval {require Foo} ) {
useFoo();
} elsif
Mark Overmeer skribis 2005-09-25 17:28 (+0200):
> Stringification/Numification should be used to let an object play its
> natural role within the program.
Agreed, but...
> For instance, some "Temperature" object producing 273 when compared to
> the melting point of water.
That's for numeric cont
* wolverian ([EMAIL PROTECTED]) [050925 11:57]:
> On Sun, Sep 25, 2005 at 12:52:08PM +0200, Juerd wrote:
> > Hackers on this list, what do you think?
>
> I think separating the two is extremely confusing. I do not see any uses
> for it, but maybe I am not thinking hard enough.
Of course, having
On Sun, Sep 25, 2005 at 12:24:52PM -0700, Chip Salzenberg via RT wrote:
> I think the right answer is to use a magic string rather than a
> magic number.
Leo and I been discussing this on #parrot and we've come to the same
conclusion. Attached is a possible patch for parrotbyte.pod that
implement
On Sun, Sep 25, 2005 at 06:00:04PM +0200, demerphq wrote:
> Is there a proper way to test both parts of dual implementation modules?
>
> In a pinch i came up with
>
> use DynaLoader;
> sub DynaLoader::bootstrap{1}; # Don't dynaload anything please.
>
> use Scalar::Util qw(refaddr); #pure
On Sat, Sep 24, 2005 at 02:13:46PM -0400, Randy W. Sims wrote:
> Is there a way to make C or C fail without manipulating
> @INC or hiding the physical file? Or more generally, how do you test all
> branches of constructs like:
>
> if ( eval {require Foo} ) {
> useFoo();
> } elsif ( eval {requi
On 9/25/05, Juerd <[EMAIL PROTECTED]> wrote:
> We can do better than equivalence testing for colors. Instead, try to
> match. Surely a *smart* match operator really is smart?
>
> $color ~~ '#FF00FF'
>==
> $color ~~ 'magenta'
>==
> $color ~~ [ 255, 0, 255 ]
Hmm.
Randy W. Sims wrote:
Is there a way to make C or C fail without manipulating
@INC or hiding the physical file?
Check out Devel::Hide. I've never used it, but it's supposed to do that.
From the SYNOPSIS:
use Devel::Hide qw(Module/ToHide.pm);
require Module::ToHide; # fails
use Devel::Hi
Michael G Schwern wrote:
On Fri, Sep 23, 2005 at 05:38:32PM +0200, Tels wrote:
If you have any ideas how to make this even more usefull, please speak
now. I will have limited email reading/writing capabilities the next two
weeks, but I *will* respond to all emails/critics/praises, even though i
Ashley Winters skribis 2005-09-25 12:26 (-0700):
> It's not a Date, it's a UnixEpochTimestamp.
That is precisely the flaw. Are you honestly likely to have that class?
If you really need an unix epoch timestamp, wouldn't you just use a very
simple integer for that? Because that's what it *is*, b
Yuval Kogman skribis 2005-09-25 21:34 (+0300):
> > if $color.as(Str) eq '#FF00FF' and "$color" eq "magenta" {
> > $Ashley++;
> > }
> $color.hex_triplet; # no alpha
> $color.name; # if we have one... or we can try to make one up (#ff0033 is
> bluish red ;-)
We can do better than equivalence test
On 9/25/05, Yuval Kogman <[EMAIL PROTECTED]> wrote:
> On Sun, Sep 25, 2005 at 10:59:38 -0700, Ashley Winters wrote:
>
> > The Stringification of a UnixEpochTimestamp should probably be the
> > same as its Integerization -- 12345678900. However, the Interpolation
> > of it should be the locale-speci
On Thu, Sep 22, 2005 at 12:07:48PM -0400, Matt Fowles wrote:
>
> > Mark Biggar writes:
> > > d) use a magic number that can also be used as the byte order indicator.
>
> I have seen architectures that swap byte ordering for 8 byte things
> (like doubles) but not 4 byte things. So that gives 3 op
On Sun, Sep 25, 2005 at 11:24:05 -0700, Ashley Winters wrote:
> I can't accept that. While you can infer that $dog will be a Dog at
> that line of code, it isn't being enforced, which means no
> compile-time error. $dog is allowed to store any kind of data, and you
> only know what methods exist in
On Sun, Sep 25, 2005 at 11:32:54 -0600, Luke Palmer wrote:
> Exactly which exception is continued?
...
> This comes up again with open(). So it's somewhere in between.
> Where?
For the open() example I don't have a solution but I know in what
direction to throw it: the same thing that makes croa
On Sun, Sep 25, 2005 at 10:59:38 -0700, Ashley Winters wrote:
> The Stringification of a UnixEpochTimestamp should probably be the
> same as its Integerization -- 12345678900. However, the Interpolation
> of it should be the locale-specific POSIX-style datetime string.
Why? What value does the st
On 9/25/05, Ashley Winters <[EMAIL PROTECTED]> wrote:
> On 9/25/05, Yuval Kogman <[EMAIL PROTECTED]> wrote:
> > Under strict type inferrencing, i'd expect this to be a compile time
> > error:
I quoted but didn't read close enough. You DID say strict type
inferencing. Never mind. :)
Ashley Winters
On 9/25/05, Yuval Kogman <[EMAIL PROTECTED]> wrote:
> Hmm... Making up these subjects is fun =)
Very interesting. :)
> Under strict type inferrencing, i'd expect this to be a compile time
> error:
>
> my $dog = Dog.new;
>
> if ($condition) {
> my Cat $c = $dog;
>
On 9/25/05, Luke Palmer <[EMAIL PROTECTED]> wrote:
> [...]
> Exactly which exception is continued?
> [...]
Named restarts in Common Lisp appear to try to solve a related
problem, if I'm skimming this thread correctly. :-) (see [1]).
Michael
[1]
http://www.supelec.fr/docs/cltl/clm/node312.html#SE
On 9/25/05, Yuval Kogman <[EMAIL PROTECTED]> wrote:
> On Sun, Sep 25, 2005 at 12:52:08 +0200, Juerd wrote:
> > Damian Conway skribis 2005-09-24 8:31 (+1000):
> > > >In my opinion, making the string value in interpolation different from
> > > >the value in Str context is madness.
> > > It's dwimmer
On 9/25/05, Yuval Kogman <[EMAIL PROTECTED]> wrote:
> I propose a new model - each exception has a continuation that
> allows it to be unfatalized.
I think we've already talked about something like this. But in the
presence of "use fatal", it makes a lot more sense.
Something comes to mind:
Hmm... Making up these subjects is fun =)
Anywho...
Since type inferrencing is going to make into Perl 6, and
allomorphism is very richly supported by the type system, i'm
wondering on the nature of the optionality...
What excatly do the users get to control? Are functions with '-->'
rich type s
Is there a proper way to test both parts of dual implementation modules?
In a pinch i came up with
use DynaLoader;
sub DynaLoader::bootstrap{1}; # Don't dynaload anything please.
use Scalar::Util qw(refaddr); #pure perl implementation
to disable an XS implementation of a module that used
To ease the understanding of exactly how this might work, assume
that perl 6 is really all continuation passing style under the
surface (parrot is ;-).
use fatal;
my $x = do_bar();
do_foo();
sub do_bar {
fail "bah";
}
The way CPS works is r
Michael Graham wrote:
Ivan Tubert-Brohman <[EMAIL PROTECTED]> wrote:
Randy W. Sims wrote:
Is there a way to make C or C fail without manipulating
@INC or hiding the physical file?
Check out Devel::Hide. I've never used it, but it's supposed to do that.
Another strategy is to take advant
On Sun, Sep 25, 2005 at 18:11:22 +0300, Yuval Kogman wrote:
> In order to support continuable exception generators, here is a
> style guide for exception values, and an observation on what
> exceptions should support at the language level:
And more...
* Exception strings are for humans
Humans ne
Ivan Tubert-Brohman <[EMAIL PROTECTED]> wrote:
> Randy W. Sims wrote:
> > Is there a way to make C or C fail without manipulating
> > @INC or hiding the physical file?
>
> Check out Devel::Hide. I've never used it, but it's supposed to do that.
Another strategy is to take advantage of the fact t
In order to support continuable exception generators, here is a
style guide for exception values, and an observation on what
exceptions should support at the language level:
* Exceptions should preserve data
All exceptions should contain as much of the original data that
caused them...
With Luke
Hi,
Suppose I'm writing a file browser, with a pane on the left to
display the filesystem hierarchy, and a frame on the right to
preview the file.
Suppose I have a convenience function, preview_file which takes a
path and returns a value that the frame display view knows to
render.
Let's define
Randy W. Sims wrote:
Is there a way to make C or C fail without manipulating
@INC or hiding the physical file?
Check out Devel::Hide. I've never used it, but it's supposed to do that.
From the SYNOPSIS:
use Devel::Hide qw(Module/ToHide.pm);
require Module::ToHide; # fails
use Devel::Hi
On Sun, Sep 25, 2005 at 12:52:08 +0200, Juerd wrote:
> Damian Conway skribis 2005-09-24 8:31 (+1000):
> > >In my opinion, making the string value in interpolation different from
> > >the value in Str context is madness.
> > It's dwimmery.
>
> It's dwymmery, or dwdmmery indeed. Not at all what I m
# New Ticket Created by Ross
# Please include the string: [perl #37258]
# in the subject line of all future correspondence about this issue.
# https://rt.perl.org/rt3/Ticket/Display.html?id=37258 >
email thread discussing the issue:
http://www.nntp.perl.org/group/perl.perl6.internals/30
On Sun, Sep 25, 2005 at 12:52:08PM +0200, Juerd wrote:
> Hackers on this list, what do you think?
I think separating the two is extremely confusing. I do not see any uses
for it, but maybe I am not thinking hard enough.
--
wolverian
signature.asc
Description: Digital signature
Paul Johnson wrote:
On Fri, Sep 23, 2005 at 12:06:43PM +0200, Thomas Klausner wrote:
Hi!
On Fri, Sep 23, 2005 at 12:54:42PM +1000, Adam Kennedy wrote:
Collecting any sort of coverage data is a complete bitch. Let me just
say right now that doing it across _all_ of CPAN is flat out impossib
Damian Conway skribis 2005-09-24 8:31 (+1000):
> They ought to, since the two are different in Perl 5.
> For example:
> my @bar = 'bar';
> print "[EMAIL PROTECTED]";
> print "foo[" . @bar . "]baz\n";
This does not compare stringification to interpolation. It compares
scalarification t
Damian Conway skribis 2005-09-24 8:31 (+1000):
> >In my opinion, making the string value in interpolation different from
> >the value in Str context is madness.
> It's dwimmery.
It's dwymmery, or dwdmmery indeed. Not at all what I mean, am likely to
mean, or will ever mean.
> Which often looks l
On Fri, 23 Sep 2005, Michael G Schwern wrote:
> On Fri, Sep 23, 2005 at 07:33:04PM +0200, Tels wrote:
> > Not yet. Good idea. The relevant code is in parse_file() in
> > gen_graph - it gets as option one .pm file and then does something
> > with it.
> >
> > The lopp for each file is in gather_data(
Does anyone has access to an IRIX machine?
-J
--
On Thu, Sep 22, 2005 at 07:37:44PM +0300, Jarkko Hietaniemi wrote:
>
> >
> > Jarkko,
> >
> > Are there still outstanding issues on IRIX? AFAIK nobody else has been
> > building parrot on that platform.
>
> Unfortunately I no more have access t
It's impossible.
Quite. I believe the only way is for the author to do the Devel::Cover
dance and forward the results. It also distributes the workload out to
where it should be done.
Since it's an optional step that has no direct bearing on the
functionality of the module, it's a sign tha
Is there a way to make C or C fail without manipulating
@INC or hiding the physical file? Or more generally, how do you test all
branches of constructs like:
if ( eval {require Foo} ) {
useFoo();
} elsif ( eval {require Alternate} ) {
useAlternate();
} else {
fake_it();
}
Thanks,
Randy
Juerd wrote:
But will they also see "foo" ~ $bar as something different from
"foo$bar"?
They ought to, since the two are different in Perl 5.
For example:
my @bar = 'bar';
print "[EMAIL PROTECTED]";
print "foo[" . @bar . "]baz\n";
And what context does "foo{ $bar }" use?
Strin
48 matches
Mail list logo