David M. Lloyd wrote:
On Thu, 4 Oct 2001, Michael G Schwern wrote:
Backtracking is at the heart of Logic Programming (or Declarative
Programming, if you like). This is one of the 3 main programming paradigms
(along with procedural and functional). The most popular Declarative
good.
--
Rafael Garcia-Suarez
On 2002.01.21 18:32 Michael G Schwern wrote:
On Sun, Jan 20, 2002 at 10:58:34PM -0800, Larry Wall wrote:
: while( my $line = FILE ) {
: ...
: }
That still works fine--it's just that $line lives on after the while.
This creeping lexical leakage bothers me. While it
}
# but $? is foo() here
}
(is temporarized the correct word, now that local() goes away?)
--
Rafael Garcia-Suarez
do { ... }\n for the
parser.
--
Rafael Garcia-Suarez
complex (and highly stateful, as opposed as
pure-lex lexers). I don't know how much of the complexity of the lexer
can be reinserted back into the grammar for perl 6.
--
Rafael Garcia-Suarez
If strain on the lexer were a design criterion, I blew it long ago.
-- Larry Wall, recently
Larry Wall wrote in perl.perl6.language :
Such a grammar switching routine could operate either over a lexical
scope or over the rest of the file. The only restriction is that
one module not clobber the grammar of a different module.
Basically, we're trying to make the opposite mistake
Dan Sugalski wrote in perl.perl6.language :
Don't forget, we already change parsing rules at compile time. Perl's
got three (maybe four) different sets of rules as it is:
*) Normal perl
*) Regexes
*) Double-quoted strings
*) Single-quoted strings
Adding another, or
Larry Wall wrote :
It's not clear that the lexer is a separate entity any more. Lexers
were originally invented as a way of abstracting out part of the
grammar so that it could be done in a separate pass, and to simplify
the grammar for the poor overworked parser.
Indeed. Another benefit
recent bleadperl and watch t/japh/abigail.t ;-)
BTW, so far toke.c hasn't been as bad as I've heard it is. :^)
Once you're used to it, it's surprisingly clear.
--
Rafael Garcia-Suarez : http://rgarciasuarez.free.fr/
\nwiffle\nbarfoo\n One matches the
last line. One matches the first line. And one matches all three lines.
And by the way, there's the semantic unaccuracy of $ matching
transparently newlines, combined with the obscure variants \z and \Z.
This needs (IMHO) some reshaping.
--
Rafael Garcia-Suarez
Larry Wall wrote :
Well, if anything, we're going the other direction, and enriching what
you can do with a backslash in single quotes slightly. But it ought
to be pretty easy to define your own hyperquotes. We might also have
options on quotes like we do on regexen. Then we could tell
Larry Wall wrote :
Paragraph mode is not going away--it's merely going elsewhere. :-)
: If so, what's the rationale? Another case of you can't do it right
: internationally, so better not to do it at all?
No, it's simply that using a global variable to control something
that should be
is : to which kind of bytecode MY.file (etc.) get compiled ?
--
Rafael Garcia-Suarez : http://use.perl.org/~rafael/
Dan Sugalski wrote :
And, FWIW, emacs is written in C. Granted a much macro-mutated
version of C, but C nonetheless.
Just like Perl 5 ;-)
Austin Hastings wrote in perl.perl6.language :
What we've got is an encoding problem at the MUA level. Mark Reed says
my mailer (Yahoo!) tagged a message containing high-bit characters as
US-ASCII. Several people the other day reported on the differences in
UTF8 vs. Latin-1 handling among
John Williams wrote in perl.perl6.language :
While purge is cute, it certainly is not obvious what it does. Of
course neither is grep unless you are an aging unix guru...
How about something which is at least obvious to someone who knows what
grep is, such as vgrep or grep:v?
If you want
Dan Sugalski [EMAIL PROTECTED] wrote:
Like I said, you can always use delegation to subclass an array,
or limit yourself to an odd and restrictive subset of behaviour.
(Basically just vtable method overriding)
Delegation has drawbacks compared to inheritance : you can't use
a object that
Damian Conway [EMAIL PROTECTED] wrote:
There are in fact *two* types associated with any Perl variable:
1. Its storage type (i.e. the type(s) of value it can hold)
This is specified before the variable or after an Cof or Creturns.
It defaults to Scalar.
frederic fabbro [EMAIL PROTECTED] wrote:
Can one see it as a shell redirection/pipe? This may sound funny,
but is the following ok?
@b ~ @a ~ @c; # @c = @b = @a;
(@b ~ @a) ~ @c; # same order i guess
so one can also:
@keep ~ grep /good/ ~ @list ~ grep /bad!/ ~
Luke Palmer [EMAIL PROTECTED] wrote:
Not necessarily. ~ will necessarily need to be right-associative,
while ~ left, however.
Not sure if you aren't getting this backwards, but anyway I often find
myself confused with right and left.
It would be logical to give them the same
precedence,
Nicholas Clark wrote in perl.perl6.language :
Actually I don't think you can define a grammar where two operators have
the same precedence but different associativity. Be it a pure BNF
grammar, or a classical yacc specification (using the %left and %right
declarations).
But that would mean
Dave Whipp wrote in perl.perl6.language :
But with the different precedence. At last, I can assign from a list without
using parentheses:
@a = 1, 2, 3; # newbie error
@a ~ 1, 2, 3; # would work
or :
@a ~ 1 ~ 2 ~ 3;
or :
1, 2, 3 ~ @a;
which would be also written as :
3 ~ 2 ~
John Siracusa [EMAIL PROTECTED] wrote:
Well, er, don't we need to decide what the subroutine attribute is, so that
the compiler will know to honor it and make the code disappear? It
doesn't seem like a feature that can be added from userland after the fact
(but maybe I'm wrong...)
In Perl
Dan Sugalski [EMAIL PROTECTED] wrote:
And keyboards, don't forget keyboards. These pesky primitive ones we
have now would require a lot of shift-control-alt-meta-cokebottle key
sequences...
And vt100 consoles ! There are still sysadmins that struggle with a buggy
perl script, having
Brent Dax wrote in perl.perl6.language :
Yes, I know this means that we have 'else if' instead of 'elsif', but
it's only two more characters and it makes the grammar cleaner.
The tokeniser could send two tokens else and if whenever it
recognizes the keyword elsif -- so this isn't a problem.
Joseph F. Ryan wrote in perl.perl6.language :
If the final design stays the way it is now, there really won't be
a lexer. Instead, a perl6 grammar parses the data, and builds up
a huge match-object as it, well, matches. This match object is then
munged into the optree.
Oh, yes, I remember
Andy Wardley wrote:
If my understanding of the design of Perl 6 is correct, the lexer, parser
and any other related components will be highly configurable and/or
replaceable. The goal is to provide support for little languages by
separating Perl the language from perl the interpreter. It
Nicholas Clark wrote:
class Foo {
...
std::size_t spare = 0
std::size_t allocate = 4096
std::size_t min_readline = 80
and have the compiler know that if I specify a member initialiser in my
my constructor, then that should be used, otherwise to default to using
the
Jonathan Scott Duff wrote in perl.perl6.language :
My only dream is that by this time next year we have a fully-
functional-people-can-use-it-in-production Perl6. It doesn't even
have to be 100% complete; I think just 85% would be enough if it were
the right 85%.
20% would be enough if
david nicol wrote:
[EMAIL PROTECTED] perl -le '$_{a}=27; package notmain; print $_{a}'
27
Gosh!
Let's document it! Would it go in perlvar or perlsyn?
It's already documented, in perlvar/Technical Note on the Syntax of Variable Names
(at the end)
Larry Wall wrote in perl.perl6.language :
On Wed, Dec 17, 2003 at 12:11:59AM +, Piers Cawley wrote:
: When you say CHECK time, do you mean there'll be a CHECK phase for
: code that gets required at run time?
Dunno about that. When I say CHECK time I'm primarily referring
to the end of
Joe Gottman wrote in perl.perl6.language :
This is unrelated to the problem you mentioned, but there is another
annoying problem with sort as it is currently defined. If you have an
@array and you want to replace it with the sorted version, you have to type
@array = sort @array;
Larry Wall wrote in perl.perl6.language :
In theory, yes, if you ask it to check in a CHECK block, and if you're
willing for the check to assume that no eval or INIT block is going
to supply the missing sub before it's actually called, and that no
run-time code is going to alias the sub into
Larry Wall wrote in perl.perl6.language :
: In perl 5 those blocks are executed at the
: transition between the compilation and the execution phase *of the main
: program*. This is convenient for some purposes (the O and B::* modules)
: and inconvient for others (Attribute::Handlers, etc. etc.).
Larry Wall wrote in perl.perl6.language :
Possibly a CHECK block that is compiled after end of main compilation
should translate itself to a UNITCHECK. But maybe it should be an error.
But it's also possible that CHECK should mean unit check, and
there should be an explicit MAINCHECK for
Damian Conway wrote in perl.perl6.language :
I'd favour UNITCHECK and CHECK, mainly for the greater compatibility with
Perl 5 and with software engineering jargon.
As far as Perl 5 is concerned, it appears that most people who write
CHECK mean UNITCHECK. Including you :)
And because
Andy Wardley wrote in perl.perl6.language :
I'm so happy! I just found out, totally by accident, that I can type
the « and » characters by pressing AltGr + Z and AltGr + X,
respectively.
Of course this information is almost completely unusable without knowing
your OS, your locale, and your
Luke Palmer wrote:
Also, if this is going to be an explanation rather than just a picture,
I suggest you go with Perl's usual versatile power, and store the
operators in a declarative data source.
grammar RPN {
my @operator = + - * / ;
rule input { line* }
Sean O'Rourke wrote:
* To really show where P6 rocks, you need to show dynamic features. A
simple example might be using a language with keywords kept in
variables, allowing you change between e.g. for, while, if, pour,
tandis-que, si, etc.
Small correction : pour, tant_que, si :)
Luke Palmer wrote:
That left recursion won't do. I can't remember my transformation rules
well enough to know how to put that in a form suitable for a recursive
descent parser. To be honest, I've never seen an RPN calculator modeled
with a grammar.
Well, the main advantage of an RPM syntax
Michele Dondi wrote:
I must say I've still not read all apocalypses, and OTOH I suspect that
this could be done more or less easily with a custom function (provided
that variables will have a method to keep track of their history, or, more
reasonably, will be *allowed* to have it), but I
On Fri, 3 Sep 2004 11:41:05 +0100, Tim Bunce [EMAIL PROTECTED] wrote:
Is there some syntax to express if the struct is packed or
needs alignment? (Perhaps that would be needed per element.)
Why am I suddenly thinking about unions ?
Aaron Sherman wrote in perl.perl6.language :
A silly question: is there a canonical character set from which we
extract these ranges? Are we hard-coding Unicode here, or is there some
way for the user to specify the character set for ranges?
Perl 5 forces [a-z] (or [i-j] for that matter) to
I just commited into bleadperl a patch that implements this :
$ ./perl -e 'no 5'
Perls since v5.0.0 too modern--this is v5.9.3, stopped at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
That is, the exact opposite of the current use VERSION syntax.
One of the uses I had
Brent 'Dax' Royal-Gordon wrote in perl.perl6.language :
Basically, I'd like to be able to mark a variable as sensitive or
secret. This implies that the language should overwrite the memory
it uses before deallocating it, and that if possible it should tell
the virtual memory system to avoid
Brent 'Dax' Royal-Gordon wrote in perl.perl6.language :
I would like is sensitive to be defined to mean that any data stored
in that variable, at any level of recursion, will be zeroed out as
soon as it is garbage collected. Particular implementations can add
extra features on top of
Smylers wrote in perl.perl6.language :
Hmmm, a pragma's a bit heavyweight for this; how about being able to set
this with a special global variable -- that sure sounds handy ...
Actually, in perl 5, $[ *is* a pragma... :)
--
Grepping the source is good for the soul. -- the perldebguts manpage
Moritz Lenz wrote in perl.perl6.compiler :
jerry gay wrote:
On Fri, Nov 21, 2008 at 10:43, via RT Moritz Lenz
[EMAIL PROTECTED] wrote:
# New Ticket Created by Moritz Lenz
# Please include the string: [perl #60732]
# in the subject line of all future correspondence about this issue.
# URL:
Richard Hainsworth wrote in perl.perl6.language :
The S16: chown, chmod thread seems to be too unix-focussed.
I was more or less thinking that the syscall-related primitives,
like chown or chmod, could go in a POSIX namespace. Even in UNIX
land nowadays the situation can be much more complex
50 matches
Mail list logo