Brent Dax wrote:
use Fcntl qw(:seek);
seek DATA, 0, SEEK_SET;
@code = DATA;
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
about this issue? ;-)
--
John Porter
A word spoken in the mind will reach its own level in the objective truth.
?
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 the more general case.)
--
John Porter
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
' for transformation of any structure to other structure..
This sort of thing should certainly not be in the kernel.
--
John Porter
= substr( $s, 10, 15 ),
@z = @a[5..8,13];
etc.
--
John Porter
David L. Nicol wrote:
No, that does not work:
Right; I misunderstood what was wanted.
--
John Porter
Sterin, Ilya wrote:
Don't really know which would be more helpful, since I first need to find a
scenerio where I would use this facility, then what result would I expect
once the shortest list runs out.
Let us ask the PDL folks.
In fact, I'm quite sure this has been done already.
--
John
, @argset2 ) {
quux;
But I'm not convinced of the utility of this over using
scalar references.
--
John Porter
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
of hashes or arrays:
for my @a ( @foo, @bar ) { ...
for my %h ( %foo, %bar ) { ...
--
John Porter
] : $_-[1]\n;
}
--
John Porter
;
}
(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
for, what hash refs
stringify to.
Um, one pragma.
--
John Porter
[EMAIL PROTECTED] wrote:
...just made them a convenience for identifying type errors...
I.e. type-safe macros.
--
John Porter
Matt Youell wrote:
The terminology was new to me, however.
I made it up.
--
John Porter
, 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
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
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
on.
--
John Porter
this could be conflated with normal labels.
--
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
:
...
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
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
have both, right? We could let classes be first-class
objects, eh?
--
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
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:
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't been around very long.
I think someone hits this tripwire at least once
David L. Nicol wrote:
Yet another minor candidate for regularization.
(Hush, David, Don't say that. Perl should stay Perl! ;-)
--
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
make_readonly or similar?
Trying to overload close to the job is just ridiculous.
Currently nothing in perl enforces access besides lexical visibility
rules.
This will of course be different in perl6.
If you're hung up on the implementation, please take it
to the -internals list.
Thank you.
--
John
,
the time warp, etc. etc... whatever your will.
--
John Porter
It's turtles all the way down!
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
Michael G Schwern wrote:
you can even do it now through ad hockery.
Or odd hackery.
:-)
--
John Porter
, right?
--
John Porter
It's turtles all the way down!
at compile time.
We'll do what we can at compile time, but this is Perl...
--
John Porter
to compilation errors.
--
John Porter
Anything essential is invisible to the eyes.
, but that's a consequence
of perl's dynamic nature.
--
John Porter
, and it casts very
opportunistically.
--
John Porter
Anything essential is invisible to the eyes.
know exactly what the statement means.
No, that is not strong typing. That is static typing.
--
John Porter
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.
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
Anything essential is invisible to the eyes.
Simon Cozens wrote:
$foo = 5;
print it + ($bar = 10) + it;
20 or 25?
or 30?
--
John Porter
of $y or $z
was evaluated, not always simply $z.
How is this done with C_ currently?
--
John Porter
arg value into Cit.
This doesn't look like something that needs support
from the compiler...
--
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
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 element int($foo) of array @bar
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
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
constrained TDI in Perl5.
--
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
[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
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
it for containers indexed by scalar as well.
--
John Porter
All men are subjects.
aren't really scalars,
but their own type. Thus they need their own prefix.
No, that does not follow.
--
John Porter
arrays and hashes.
--
John Porter
Simon Cozens wrote:
A scalar's a thing.
Just as the index into a multiplicity is a thing.
--
John Porter
.
The result would be two types of variables: single and multiple.
Ah! :-)
--
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
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
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
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 Cnext FOO looks like
a method call. (And he only thinks that because next
looks like a method name.)
--
John Porter
All men are subjects.
Simon Cozens wrote:
John Porter wrote:
Cnext FOO 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 in $source.
Not that there are any
a method call on a loop control object?
--
John Porter
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
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.)
--
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
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
/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.
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
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
Simon Cozens wrote:
John Porter wrote:
$thing is;
Existence is not the same as essence.
strike() while $the_iron is;
--
John Porter
da Du ron ron ron
--
John Porter
[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
--
John Porter
All men are subjects.
*does* mean
FOO.next
--
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
.
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.
Rocco Caputo wrote:
$thing's veracity is true.
What about just
$thing is;
--
John Porter
All men are subjects.
,
not a specialization link.
--
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.
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.
@pi are square;
@dogs have fleas;
@talks have stalled;
--
John Porter
, 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
It's so mysterious, the land
Michael G Schwern wrote:
And I'm quite sure there's an RFC for doing something like this alread
up for Perl 6.
At least RFC 199, and several related threads
such as $a in @b.
--
John Porter
It's so mysterious, the land of tears.
know.
distributed objects,
I don't recall discussion of this wrt perl6, frankly.
Or are we thinking on a totally separate line that just has a
few similarities?
Yes. Do you feel better now?
--
John Porter
It's so mysterious, the land of tears.
Michael G Schwern wrote:
If we could determine if the block has no side effects... oh wait,
everything in Perl has a side effect. ;)
:pure (again!)
--
John Porter
Dan Sugalski wrote:
I'd like to be able to do:
$foo = new Bar;
print SOCKET serialze($foo);
and on the other end do:
$foo = unserialize(SOCKET);
$foo-bar();
I personally am a big fan of Obliq semantics.
It's something I'd really like to see in perl.
--
John Porter
It's so
this thread.
--
John Porter
It's so mysterious, the land of tears.
what he's talking about?
OReilly::Policy is (or might be) still general before
specific. OReilly::* might be a whole family of site-
specific modules. I think that's safer than supposing
a universe of Policy::* policy modules.
--
John Porter
Larry Wall wrote:
Now we just need to make ... ___ ... mean something exceptional.
Ref: http:[EMAIL PROTECTED]/msg02873.html )
--
John Porter
site.
--
John Porter
be construed this way.
--
John Porter
It's a sky-blue sky
The satellites are out tonight
let x = x
this (as in in C++):
$obj.operator=('x');
--
John Porter
It's a sky-blue sky
The satellites are out tonight
let x = x
of an identifier where otherwise
a string literal would be understood.
my @things; # declare that things is an array
print things are $things;
# second occurrence of things here is taken as a variable name.
# its type -- array -- is already known.
--
John Porter
don't need to worry about that.
--
John Porter
It's a sky-blue sky
The satellites are out tonight
let x = x
Graham Barr wrote:
The other choice is not to have a concat operator but instead have
Cconcat LIST, but I guess not many people would like that either.
sub concat(@) { join '', @_ }
Seems to me like the sort of thing that ought to be in the core.
--
John Porter
Dan Sugalski wrote:
The one downside is that you'd have essentially your own private language.
Whether this is a bad thing or not is a separate issue, of course.
IIUC, this ability is precisely what Larry was saying Perl6 would have.
--
John Porter
is, or ^ or
#, or whatever.
Or maybe a word operator, in the same family as cmp, eq, ne, le, gt...
Perl's stigma for unreadability is bad enough already;
now at least we have a good opportunity to unwreak some badness.
--
John Porter
1 - 100 of 446 matches
Mail list logo