2/3 of the way down.
(Hm, do you think I care about this issue? ;-)
--
John Porter
A word spoken in the mind will reach its own level in the objective truth.
Brent Dax wrote:
> > use Fcntl qw(:seek);
> > seek DATA, 0, SEEK_SET;
> > @code = ;
>
> IMHO, that's too hackish--just reading that doesn't make what you're
> doing obvious.
It also can only get the main program, not any of the modules it loads.
--
John Porter
Michael G Schwern wrote:
> On Mon, Aug 27, 2001 at 10:58:00AM -0400, John Porter wrote:
> > You can, with C< goto &$foo; >.
> > Problem is, it's *slower* (in p5 anyway) than the plain sub call.
>
> By only 10%. Let's keep things in proportion here.
O.k
Ken Fox wrote:
> The only thing I'd like to change is to make &foo a tail call instead
> of a normal function call. But I guess that would *really* confuse
> people.
You can, with C< goto &$foo; >.
Problem is, it's *slower* (in p5 anyway) than the plain sub call
in terms
of real-world programming.
--
John Porter
Science class should not end in tragedy.
atical nonsense)
> So instead, I'd like
>
> "my outer $x" to be shorthand for
I guess you missed where I suggested that putting "my" on that
declaration is also counter-sensical, not to mention redundant.
"my" implies a brand-spanking-new lexical variable attached
to this very scope. The semantics of "outer" (or "closed"...)
can be defined to imply a lexical variable.
--
John Porter
Dave Mitchell wrote:
> ie by default lexicals are only in scope in their own sub, not within
> nested subs - and you have to explicitly 'import' them to use them.
No. People who write closures know what they're doing.
When's the last time someone "accidental
David L. Nicol wrote:
> eval ${code}o;
Another brilliant idea from David Nicol!
However, I'm not keen on the syntax.
I'd rather see a different keyword. I'm thinking "eval1",
but I'm not very creative. :-/
--
John Porter
Science class should not end in tragedy.
Bart Lateur wrote:
> This has a vague smell of Fortran.
Nothing vague about it. It is exactly analogous to Fortran's three-way if.
--
John Porter
hat to understant?
> What you're asking has no counterpart in boolean logic, and
> as such would make no sense in any computer language.
Screw boolean. It's just a three-way switch, exactly as if/else
is a two-way switch. (As has been noted, switch() would handle this
and
s been done already.
--
John Porter
David L. Nicol wrote:
> No, that does not work:
Right; I misunderstood what was wanted.
--
John Porter
$y => substr( $s, 10, 15 ),
@z => @a[5..8,13];
etc.
--
John Porter
all it
> 'transform' for transformation of any structure to other structure..
This sort of thing should certainly not be in the kernel.
--
John Porter
is:
for ( \@foo, \@bar ) {
print "$_->[0] : $_->[1]\n";
}
--
John Porter
orm of "for" which can iterate
over a list of hashes or arrays:
for my @a ( @foo, @bar ) { ...
for my %h ( %foo, %bar ) { ...
--
John Porter
le source will use the
> temp variable there is still a need for an explicit scalar like $_.
> Unless there is something I am missing from this discussion.
No. with() must be consistent with other perl constructs.
If implemented, it will use $_. Plain and simple.
--
John Porter
( @argset1, @argset2 ) {
&quux;
But I'm not convinced of the utility of this over using
scalar references.
--
John Porter
} ) {
$_->cells(1,1) = "Title";
$_->language() = "English";
}
(presuming lvalue-methods, of course...)
--
John Porter
Uri Guttman wrote:
> one related point is that this symbol table will be accessible via
> caller() so you could access/install lexical symbols in a parent block
> on the call stack. scary!
Quite. Does anyone have a pointer to tchrist's rant on Tcl's upvar?
--
John Porter
[EMAIL PROTECTED] wrote:
> ...just made them a convenience for identifying type errors...
I.e. type-safe macros.
--
John Porter
n.
> This would be a nice thing to have a pragmata for, what hash refs
> stringify to.
Um, one pragma.
--
John Porter
Matt Youell wrote:
> The terminology was new to me, however.
I made it up.
--
John Porter
Right. Perl doesn't have it by default, and *can't* have it
except under certain rather strict constraints, e.g. when all
players are playing by the Class::Struct rules, or some other
more elaborate alternative.
--
John Porter
can always do this right now:
> ...
> my $obj = Class::Object->new;
> ...
No, that's not an inner class. Man, you think Class::Object
is the answer to everything! (Not that it ain't cool...)
--
John Porter
Michael G Schwern wrote:
> my package Foo {
> sub bar { ... }
> }
Well... "package" is a magic perl5-inducing keyword in perl6, right?
Maybe "namespace" is the way to go.
--
John Porter
erhaps this could be conflated with normal labels.
--
John Porter
to
tack on.
--
John Porter
ture aggregation by inheritance,
and (nested) namespace scoping. I think there's been plenty of
call for the former in Perl6; the latter would be pretty nice too.
--
John Porter
ed Self, only Lisp and Perl to do this.
It actually is very applicable in programming Frame systems,
which are a kind of souped-up semantic network thing,
used a lot in knowledgebases.
--
John Porter
$obj eq
> 'Some::Class' wrecks subclassing,
ref($a) eq ref($b).
> What's the trade-off here? It works, its efficient, the hacks are
> well encapsulated.
Having it in the core, in C[++], would be that much more efficient,
and that much less of a hack. Maybe the tradeoff is that it
wouldn't work. :-)
--
John Porter
do it in a module, don't
> put it in the core.
No, that's a lousy rule of thumb. The tradeoffs must be considered.
Otherwise we'd have Forth. (Or Lisp, ca. 1960.)
--
John Porter
David L. Nicol wrote:
> Yet another minor candidate for regularization.
(Hush, David, Don't say that. Perl should stay Perl! ;-)
--
John Porter
Mark J. Reed wrote:
> John Porter wrote:
> > Mark J. Reed wrote:
> > > ... be sure that "Perl stays Perl".
> > Eh, puke.
> I'm sorry?
"Keep Perl Perl" is a non-argument. And if you haven't heard me
rail against it yet, you haven'
s.
I would think that if instance.ISA is set, then, in effect, I'm
saying "I am my own class!" Specifically, it would bizarre (in a
cool kind of way ;-) for there to be two inheritance trees - one
defined by my own .ISA list, and one defined by the class into
which I'm blessed.
--
John Porter
Mark J. Reed wrote:
> ... be sure that "Perl stays Perl".
Eh, puke.
Anyway, as long as the class-level @ISA (or Class.ISA, hopefully)
is the fall-back default for any instance that doesn't have its
own .ISA set, then current semantics are retained.
--
John Porter
I believe,
in Frame systems as well.
--
John Porter
tance for it.
We could have both, right? We could let classes be first-class
objects, eh?
--
John Porter
Hmm... very much like a module I wrote (but never released to CPAN),
called Class::Multi. It was indended as my answer to multimethods,
although it doesn't resemble multimethods at all.
It delegates to both classes and instances.
--
John Porter
n the implementation, please take it
to the -internals list.
Thank you.
--
John Porter
.
Freedom is freedom to do the watusi, the shy tuna, the hip-o-crit,
the time warp, etc. etc... whatever your will.
--
John Porter
"It's turtles all the way down!"
of active discussion,
so just stay tuned.
--
John Porter
re talking about, right?
--
John Porter
"It's turtles all the way down!"
Michael G Schwern wrote:
> you can even do it now through ad hockery.
Or odd hackery.
:-)
--
John Porter
Michael G Schwern wrote:
> Basically, any class which wants to be type-checked at compile time.
I think the meaning of that is still not clear,
given what "strong typing" usually means.
--
John Porter
David L. Nicol wrote:
> it isn't currently in 5.6.1's
>
> bool
> Perl_hv_exists(pTHX_ HV *hv, const char *key, U32 klen)
>
> function (contrary to what John Porter said)
Huh? What did I say?::
--
John Porter
#x27;t think it
should not have a run-time component.
I.e. "strong typing can only be done at compile time".
We'll do what we can at compile time, but this is Perl...
--
John Porter
in
Perl, instead of in low-level languages like Fortran and Java.
And it may explain why programs written in Perl -- dynamic,
weakly-typed though it be -- are at least no more buggy than
programs written in low-level languages.
But I think we've strayed into the topic of advocacy.
--
John Porter
upplied, the expression is "rejected".
Withing its own static type system, perl is fairly strong.
When it comes to user types (classes), perl is utterly
weak. I expect that will change in perl6.
--
John Porter
"Anything essential is invisible to the eyes."
unt of (sane) typing will allow your compiler to
know that
if ( x > y )
is wrong when you meant to say
if ( x < y )
That is what is meant by "logic error".
--
John Porter
"Anything essential is invisible to the eyes."
where) and
> b - at compile time
> you know exactly what the statement means.
No, that is not "strong typing". That is "static typing".
--
John Porter
of a "type" is different from other languages.
It *does* check these types, and it "casts" very
opportunistically.
--
John Porter
"Anything essential is invisible to the eyes."
is very unPerlish.
It could work in perl when perl is being used in an FP manner;
that would indeed be very Perlish.
--
John Porter
"Anything essential is invisible to the eyes."
e, that's a run-time check, but that's a consequence
of perl's dynamic nature.
--
John Porter
Execution of -e aborted due to compilation errors.
--
John Porter
"Anything essential is invisible to the eyes."
.g. It() --
It( $x + y ) > $limit and return it;
It() socks its arg value into C.
This doesn't look like something that needs support
from the compiler...
--
John Porter
think "it" should refer to whichever of $y or $z
was evaluated, not always simply $z.
How is this done with C<_> currently?
--
John Porter
Simon Cozens wrote:
> $foo = 5;
> print it + ($bar = 10) + it;
>
> 20 or 25?
or 30?
--
John Porter
Dan Sugalski wrote:
> So what happens when you assign an overloaded value to a tied variable, or
> vice versa? Which wins?
Uh, the overloaded value gets evaluated to an normal value,
and the tied variable does what it does with that.
Maybe.
--
John Porter
)(1,2,3,...))
But it's also equivalent to
{
my ($x,$y,$z,...) = (1,2,3,...);
FOO
}
which is far clearer than either of the above syntaces.
--
John Porter
Simon Cozens wrote:
> I'm not telling you how it *looks* in Perl 5, I'm telling you (in Perl 5
> terms) what it will *mean*.
Fine, you're using perl5 as pseudocode.
I could do that too. But it has no bearing on the
desirability of anyone's proposed perl6 syntax or
semantics.
--
John Porter
isn't defined by how
we were constrained TDI in Perl5.
--
John Porter
Bart Lateur wrote:
> As to what the combined
> $bar[$foo]
> would mean: that depends on what $bar contains.
I think it would depend on what the declared type
of @bar was (i.e. ordered or "associative").
--
John Porter
Graham Barr wrote:
> As I said in another mail, consider
> $bar[$foo];
> $bar{$foo};
But if @bar is known to be one kind of array or
the other, where is the ambiguosity that that is
meant to avoid?
--
John Porter
Damian Conway wrote [and John Porter reformats]:
>
> @bar[$foo]; # Access element int($foo) of array @bar
> %bar{$foo}; # Access entry "$foo" of hash %bar
> @bar{$foo}; # Syntax error
> %bar[$foo]; # Syntax error
And why is that superior to:
@bar[$foo]; # Access e
[EMAIL PROTECTED] wrote:
> Property should be an adjective, not a noun.
While I'm inclined to want to disagree with you
100% on that, I really only disagree 50%. :-)
--
John Porter
Larry Wall wrote:
> Let's not confuse Perl 6, the Language, with Perl 6, the Implementation,
> which includes compatibility apparatus that knows about Perl 5.
Maybe we need more difference in the names than "exactly one bit".
"PVM"? No, that's in use already...
--
John Porter
Makes sense to have it for containers indexed by scalar as well.
--
John Porter
All men are subjects.
Dave Storrs wrote:
> *4<$STDIN # Next 4 lines
> *$num_lines<$STDIN # Numifies $num_lines, gets that many
> *int rand(6)<$STDIN # Gets 0-5 lines
> *&mySub($bar)<$STDIN# mySub returns num, gets that many
Shades of printf...
--
John Porter
-defined scheme.
> The result would be two types of variables: single and multiple.
Ah! :-)
--
John Porter
Simon Cozens wrote:
> A scalar's a thing.
Just as the index into a multiplicity is a thing.
--
John Porter
lating
arrays and hashes.
--
John Porter
you're really saying is that references aren't really scalars,
> but their own type. Thus they need their own prefix.
No, that does not follow.
--
John Porter
David L. Nicol wrote:
> That also wraps up the "for should have an explicit
> iterator access method" thread handily! Just label your loop and
> there you are!
Well, right. Every loop would have a control object,
whether it's nonymous or a-.
--
John Porter
in,
I refer readers to the archived discussions of RFC28.
Suffice it to say that, contrary to some opinions, OO and FP
are useful to more than just CS graduates.
Part of Perl being Perl is being something greater than
a lowest common denominator.
--
John Porter
uot;less" from the current position backwards. This
> notion could be generalized to files/networks/stacks/datastructs/etc/etc.
Ugck. < means read, > means write. Do you want to be that
different from shell? Or from Perl, for that matter?
--
John Porter
All men are subjects.
Larry Wall wrote:
> We're not so far off of a yield-like
> method on continuations here...
> ... ordinary blocks that can function as continuations
> to the surrounding list context.
Ah! Now we're talking!
--
John Porter
Me wrote:
> And, despite perl5's use of no as the opposite
> of use, and given that there may be no use in
> perl6 (;>), and thus perhaps no no, (on and off?),
> then maybe no could be used as not yes?
Well clearly "on" is the opposite of "no". Yes?
--
John Porter
Simon Cozens wrote:
> An object with exactly one and only one method doesn't sound that
> dynamic to me.
Bit of a digression; but, the dynamicity of a language is in
no way implicated by the number of methods in one build-in
class. (Besides, this class will have at least three.
Simon Cozens wrote:
> Then I call Occam's Razor. Perl is supposed to be easy, no?
It's also supposed to have an implementation.
And to have a consistency level somewhat greater than zero.
Also, consider the implications for user-defined control
constructs.
--
John Porter
s, that "next FOO" is
actually a method call on a loop control object?
--
John Porter
Simon Cozens wrote:
> John Porter wrote:
> > C looks like a method call
>
> It doesn't,
Oh, but it does, to the perl6 programmer who's used to
thinking
$source.next
(or its "indirect object" alternative,
next $source
) iterates the iterator
s now (an alias to) a loop control object...
next FOO;
What's unclear?
In fact, no one needs to know this is going on, except
the guy who wants to know why C looks like
a method call. (And he only thinks that because "next"
looks like a method name.)
--
John Porter
All men are subjects.
Peter Scott wrote:
> Even if it has a
> fixed-length prototype, is Perl smart enough to know that it can't be
> called as an object method, bypassing prototype checking?
Maybe p6 won't have that loophole.
--
John Porter
Simon Cozens wrote:
> John Porter wrote:
> > a syntactic loop control iterator object
>
> I surely hope you're joking.
Why? It sounds reasonable to me (if not necessarily
desirable). Perl is a highly dynamic language, I
think it could support this.
--
John Porter
Larry Wall wrote:
> Ordinary "next" methods don't do a goto.
Well, of course, the "next" method of a syntactic
loop control iterator object would not be ordinary. :-)
--
John Porter
have to use some klunky
combination of both views.
If the hash variable type had some method for accessing the set of keys
directly as a (pseudo)array, that would be one way to neatly solve the
problem. That's why I proposed the @%foo syntax. But more python-like
syntaces are possible, if desired.
--
John Porter
All men are subjects.
Edward Peschko wrote:
> If
> %a = @b;
> does
> %c = map{ ($_ => undef ) } @a;
Yep... particularly considering something neat like
keys(%a) = @b;
could be defined to do that. Or, even niftier
@%a = @b;
--
John Porter
ator objects?
So that
next FOO
really *does* mean
FOO.next
--
John Porter
All men are subjects.
tp://www.min.net/~jdporter/setashash.html
--
John Porter
All men are subjects.
> [EMAIL PROTECTED] writes:
> :
> : why should a reader expect that a declarative description
> : of &foo would be followed by the body of &foo?
Isn't the functional definition of a sub
just another one of its attributes, anyway?
--
John Porter
da Du ron ron ron
--
John Porter
Simon Cozens wrote:
> John Porter wrote:
> > $thing is;
> Existence is not the same as essence.
strike() while $the_iron is;
--
John Porter
Rocco Caputo wrote:
> $thing's veracity is true.
What about just
$thing is;
--
John Porter
All men are subjects.
@pi are square;
@dogs have fleas;
@talks have stalled;
--
John Porter
Michael G Schwern wrote:
> "$foo has true" doesn't flow as well as "$foo is true".
But the general form, something like
$thing is a_property
or
$thing is a_behavior
flows considerably worse, IMHO.
--
John Porter
It's so mysterious, the land of tears.
Bart Lateur wrote:
> I hardly ever restrict
> myself to word characters in the end delimiter, anyway.
Interesting -- I *always* use "EOF", because that's the
only one vim knows a priori how to highlight correctly. :-/
--
John Porter
It's so mysterious, the land of tears.
lly implies a generalization link,
not a specialization link.
--
John Porter
It's so mysterious, the land of tears.
should support at all, or is it best left to the OS to provide
> a solid chroot facility?
IMHO this is one of those things that should be kept firmly
in the front of our minds as we design the engine.
It is yet another area in which we could do right what java
got half-right.
--
John Porter
em. And I hope that ends this thread.
--
John Porter
It's so mysterious, the land of tears.
1 - 100 of 576 matches
Mail list logo