On 10/23/06, Smylers <[EMAIL PROTECTED]> wrote:
Markus Laire writes:
> Does anyone know if programming languages are protected by copyright
> or not?
Code can be copyrighted; ideas can't be.
Yes, but the syntax of the programming language is more than just an idea.
Copyri
everyone
is picking-and-choosing what they want from other programming
languages. So I'd like to ask whether this is legal or not and why?
--
Markus Laire
tem *
S02>
S02> A bare closure also interpolates in double-quotish context. It may
S02> not be followed by any dereferencers, since you can always put them
S02> inside the closure. The expression inside is evaluated in scalar
S02> (string) context. You can force list context on the expression using
S02> the C operator if necessary.
--
Markus Laire
foo == 123 {
...
}
else {
...
}
is same as
if $foo == 123 {
...
}; # <-- notice the semicolon here
else {
...
}
because if-statement could end there.
--
Markus Laire
tement):
>"Unlike in Perl 5, applying a statement modifier to a do block is
>specifically disallowed
Oh. For some reason, I thought this exception was for loops only.
According to S04 C is a loop, "The do-once loop".
--
Markus Laire
is ambiguous though.
It really is, and the very first question that everyone asks is: how do
I get access to the outer loop variable, which of course, you cannot for
the reasons stated above.
What about $OUTER::_ ? Shouldn't that access the outer $_ ?
Let's get P6 out the door, an
y different.
As an example, C<[+](1,2,3)> is same as C<1+2+3> so IMHO C<[,](1,2,3)>
should be same as C<1,2,3> but S06 says that it becomes C<\(1,2,3)>.
--
Markus Laire
On 9/23/06, Audrey Tang <[EMAIL PROTECTED]> wrote:
在 Sep 23, 2006 8:36 PM 時,Markus Laire 寫到:
> On 9/23/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>> @args = [EMAIL PROTECTED],1,2,3;
>> -push [,] @args;# same as push @foo,1,2,3
>> +pu
t;[EMAIL PROTECTED],1,2,3> just as C<[+] 0,1,2,3> is equivalent to C<0+1+2+3>?
So why is there C<:> instead of C<,> after C<@foo>?
Does this have something to do with the fact that C<@args> is
C<[EMAIL PROTECTED],1,2,3> and not C<@foo,1,2,3>?
--
Markus Laire
in-editor parsers fall over screaming ;)
That would be quite close to [\+] [\,] etc.. from S03:
S03> say [\+] 1..* # (1, 3, 6, 10, 15, ...)
--
Markus Laire
pugs> any(@a) ~~ { $_ % 2 }
(Bool::False | Bool::True)
--
Markus Laire
less there's a tie, in
which case the tied candidates are redispatched using any additional
tiebreaker long names (see below).
If a tie still results, only candidates marked with the default trait
are considered, and the best matching default routine is used. If
there are no default routines, or if the available defaults are also
tied, a final tie-breaking proto sub is called, if there is one (see
above). Otherwise an exception is thrown.
--
Markus Laire
ntext. Therefore
+
+@a = 1, < 2 3 >, 4;
+
+is equivalent to
+
+@a = 1, 2, 3, 4;
Shouldn't this be
@a = 1, '2', '3', 4;
--
Markus Laire
On 8/18/06, Larry Wall <[EMAIL PROTECTED]> wrote:
On Fri, Aug 18, 2006 at 12:56:30PM +0300, Markus Laire wrote:
: What about combined short switches like C<-abc> to mean C<-a -b -c>?
: Will perl6 support this notation or not?
Hmm, that opens up a world of hurt. Either you hav
short switches like C<-abc> to mean C<-a -b -c>?
Will perl6 support this notation or not?
--
Markus Laire
many other languages uses for they
comparison than more cryptic eqv.
Also, == does "simpler" comparison than eq, so I feel that === should
also do "simpler" (to understand) comparison than eqv
--
Markus Laire
they were mutable types:
$bar = [1,2];
$foo = $bar;
...
$bar = 123; # This doesn't affect $foo
Of course, type-allowed mutation of $bar will affect $foo if $bar is
mutable type.
Still, thanks for clarification - I misunderstood what you meant with
"someone else holding another symbol".
--
Markus Laire
On 8/16/06, Dr.Ruud <[EMAIL PROTECTED]> wrote:
"Markus Laire" schreef:
> my $x = 'Just Another';
> my $y := $x;
> $y = 'Perl Hacker';
>
> After this, both $x and $y contain the string "Perl Hacker", since
> they are r
assignment. It is performed with the := operator.
Instead of replacing the value in a container like normal assignment,
it replaces the container itself. For instance:
my $x = 'Just Another';
my $y := $x;
$y = 'Perl Hacker';
After this, both $x and $y contain the string "Perl Hacker", since
they are really just two different names for the same variable.
--
Markus Laire
broutine extends from that statement to the end of the file, as C and
-C declarations do).
-
Redefining a stub subroutine does not produce an error, but redefining
an already-defined subroutine does. If you wish to redefine a defined sub,
you must explicitly use the "C" trait.
====
--
Markus Laire
+Piping to the C<*> "whatever" term is considered a feed to the lexically
"Piping" should probably be changed to something else.
--
Markus Laire
rom S10
AUTODEF, CANDO
Submethods from S12
BUILD, BUILDALL, CREATE, DESTROY, DESTROYALL
Pseudo-class from S12
WALK
I might've missed some.
So making statement modifiers uppercase would just be an another place
where perl6 uses uppercase reserved words.
--
Markus Laire
On 7/20/06, Smylers <[EMAIL PROTECTED]> wrote:
Markus Laire writes:
> S04 seems to say that a style like this can't be used by
> perl6-programmers:
>
> loop
> {
>...
> }
> while $x;
>
> I like this style, as it lines up both the keywords and the c
;s necessary to make this programming-style
invalid for perl6? This style is used at least by "GNU Coding
Standards" (section 5.1) at
http://www.gnu.org/prep/standards/standards.html
I also like this style, as it lines up both the keywords and the curlies.
--
Markus Laire
s fine, and means
+
+q:n /stuff/
+
+while
Since quotes can have whitespace before the first/opening delimiter,
but functions can't (according to S03), how is C parsed? (Notice
the space before parens).
Would that be parsed as invalid function-call (i.e. syntax error) or
valid quote?
--
Markus Laire
irst
passes stuff, second passes [stuff])
--
Markus Laire
ther can Int ever be "best candidate" for Num, because
they are different types?
The programmer put type information in the sig for a reason. I think
that reason is that they wanted to be careful about what was allowed
to be passed to the subroutine. Autoconversion seems to defeat that.
-Scott
--
Jonathan Scott Duff
[EMAIL PROTECTED]
--
Markus Laire
t. The argumentless C<*> and C<**> forms are probably only
-useful in "dimensional" list contexts.
Is there any new format to do the equivalent of C<@foo[1;**;5]>, or is
that impossible nowadays?
--
Markus Laire
And here I mis-read < as <=.
Perhaps I should stop "fixing", as I'm making too many errors here...
On 5/10/06, Markus Laire <[EMAIL PROTECTED]> wrote:
> > filter (list [<] @array) @array ==>
> > first monotonically increasing run in @
On 5/9/06, Jonathan Scott Duff <[EMAIL PROTECTED]> wrote:
On Tue, May 09, 2006 at 06:07:26PM +0300, Markus Laire wrote:
> ps. Should first element of scan be 0-argument or 1-argument case.
> i.e. should list([+] 1) return (0, 1) or (1)
I noticed this in earlier posts and thought
In the previous mail I accidentally read [<=] as [>=]
On 5/10/06, Markus Laire <[EMAIL PROTECTED]> wrote:
> > filter (list [<=] @array) @array ==>
> > first monotonically non-decreasing run in @array
>
> So @array = (1 0 -1 -2 -1 -3) ==>
<= 0 <= -1 <= -2,
1 <= 0 <= -1 <= -2 <= -1,
1 <= 0 <= -1 <= -2 <= -1 <= -3
==>
Bool::True, Bool::True, Bool::True, Bool::True, Bool::False, Bool::False
And so
filter (list [<=] @array) @array
would give first 4 elements of @array, i.e. (1, 0, -1, -2)
--
Markus Laire
1-argument case.
i.e. should list([+] 1) return (0, 1) or (1)
--
Markus Laire
i.e. [+]
with no arguments)
--
Markus Laire
There is a typo in S09 (patch included)
Also, S09 uses postfix ... to mean ..Inf but S03 uses ..* for this, so
one of these should likely be changed unless both are OK.
--
Markus Laire
patch-S09
Description: Binary data
On 5/4/06, Paul Johnson <[EMAIL PROTECTED]> wrote:
On Thu, May 04, 2006 at 01:56:44PM +0300, Markus Laire wrote:
Thanks for taking the time to explain this. The long dot here does seem to be
solving more important problems. Now I'm not as up to date with Perl 6 syntax
as I once
On 5/4/06, Juerd <[EMAIL PROTECTED]> wrote:
Markus Laire skribis 2006-05-04 14:55 (+0300):
> When reading Synopses, I sometimes notice some mistakes or typos,
> which I'd like to submit a patch for, but it's not easy to do so as I
> don't know where to get the sour
, so that submitting patches would be
easier?
--
Markus Laire
ill possible to align accessors by explicitly using
the long dot syntax:
%monsters.{'cookie'} = Monster.new;
%people\ .{'john'} = Person.new;
%cats\ .{'fluffy'} = Cat.new;
--
Markus Laire
lies are taken to be a closure
returning an Int or a Range object. "
So you can just put any closure which returns Int or Range directly
within the curlies.
--
Markus Laire
to reset to before the key for some reason, you can always
> set .pos to $.beg, or whatever the name of the method is. Hmm,
> that looks like it's unspecced.
This seems interesting. From day-to-day it becames harder to fully
understand this perl6 thing, but I like it :)
--
Markus Laire
7;s just counted as "matched", whatever that means, and why the
description is so dis-similar to the first quote.
--
Markus Laire
code assertion) instead of <( ... )>
(result capture)?
--
Markus Laire
f $x <= 5 && $x <= 5 {say 'smaller'}
>
> can be permuted into
>
> if $x <= 5 && 5 > $x {say 'smaller'}
>
> and optimized to
>
> if $x == 5 {say 'smaller'}
Do you claim that
if $x <= 5 && $x <= 5 {say 'smaller'}
is same as
if $x == 5 {say 'smaller'}
--
Markus Laire
Sam Vilain wrote:
ps, X11 users, if you have any key bound to "AltGr", then "AltGr" + C
might well give you a ¢ sign without any extra reconfiguration.
For me AltGr + C gives Copyright-symbol "©".
(SuSe 9.1, tested in konsole, kwrite and thunderbird)
--
Markus Laire
Bryan Burgers wrote:
On 10/15/05, Luke Palmer <[EMAIL PROTECTED]> wrote:
On 10/14/05, Markus Laire <[EMAIL PROTECTED]> wrote:
Perl does have CPAN, but the problem is that there are no standard
modules, and so there can be several modules doing the same thing.
And what is the
if (!InitGraphics(100, 100, 24)) {
print "Couldn't get 100x100x24 graphics area\n";
exit 2;
}
// do something
DrawLine(0, 0, 99, 99);
// ...
--
Markus Laire
; @m[0][1]
(3, 4)
pugs> @m[0][0]
(1, 2)
pugs> @m[0][0][1]
2
@m = [[1,2],[3,4]] IS NOT same as @m = ([1,2],[3,4])
pugs> my @m = ([1,2],[3,4])
({ref:}, {ref:})
pugs> @m[0]
(1, 2)
pugs> @m[0][1]
2
--
Markus Laire
x27;t work in r3723
and
pugs> my @m = ([1,2],[3,4])
({ref:}, {ref:})
pugs> @m[0,1]
({ref:}, {ref:})
pugs> @m[0..3]
({ref:}, {ref:}, undef, undef)
--
Markus Laire
Juerd wrote:
Juerd skribis 2005-05-14 17:23 (+0200):
Markus Laire skribis 2005-05-14 18:07 (+0300):
[>>+^=<<] (@a, @b, @c)
These arrays flatten first (otherwise [+] @foo could never calculate the
sum of the elements), so imagine that you have
$foo, $bar, $baz, $quux, $
not too familiar with xor, so here's an easier example with plain +=
my @a = (1,2,3);
my @b = (10,20,30);
my @c = (100,200,300);
[>>+=<<] (@a, @b, @c);
# i.e. @a >>+=<< @b >>+=<< @c
# now @c = (100, 200, 300)
# @b = (110, 220, 330)
# @a = (111, 222, 333)
--
Markus Laire
that slightly inconsistent with :p meaning :p(1) the so-called
"real winner for passing boolean options" of A12?
Perhaps spec should be changed so that :p means :p(bool::true) or :p(?1)
and not :p(1)
--
Markus Laire
ch, ::Match, ::Match, ::Match, ::Match)
pugs> map { ~$_ } [split /(..)*/, 1234567890][1]
('12', '34', '56', '78', '90')
pugs> map { $_.from } [split /(..)*/, 1234567890][1]
(0, 2, 4, 6, 8)
--
Markus Laire
hing we've said for arrays applies to hashes
as well ..."
S04 tells how to process several lists in parallel in for-loop.
S03 tells about unary * list-flattening op.
So what about:
for @b ¥ @c -> $b, $c { $hash->{dims ([EMAIL PROTECTED],$b)} = $c }
ps. I'm not 100% sure if I got that ([EMAIL PROTECTED],$b) right. I want to add $b to
@a and feed it to dims as one list.
--
Markus Laire
ideas to a mathematically minded person...
my $speed_a = 78`Kilometers / 2`Hour;
my $speed_b = 50`(Miles/Hour); # or 50`Miles_per_Hour
my $delta = $speed_a - $speed_b;
--
Markus Laire
of 'x')
Still this only shortens it by one char...
(Not sure if I like this at all - just an idea...)
--
Markus Laire
What should index("Hello", "", 999) return in perl6?
In perl5 that returns 5, but IMHO -1 would be right result.
--
Markus Laire
@values);
}
How would the if (...) {...} work if there were more than one possible
match to this equation?
How would I rewrite this example to be more general, so that given 3
strings (in this case 'send', 'more', 'money'), the program would give
all possible results for the equation + =
.
--
Markus Laire
ust 2 possible values.)
Then a programmer could write
while foo() ?== true {...}
and it would be ok. After all, perl is all about giving more than one
way to do it.
--
Markus Laire
he boolean operators to return one of (yes, no,
sometimes) instead of plain (true, false) :)
Anyway, what are the usual semantics with junctions & boolean operators
in some other languages? (This is so new concept to me, that I don't
know of any language to compare against.)
--
Markus Laire
to varrant their own sigil?
Luke
--
Markus Laire
. :-)
There are few messages going there now, but at least I don't receive
them via perl6-all, only via perl6-documentation
(I'm on both lists, just in case)
--
Markus Laire 'malaire' <[EMAIL PROTECTED]>
ea of having Unicode
> operators.
It may seem idiotic to the egocentric people who only needs chars a-z
in his language. But for all others (think about Chinese), Unicode is
real asset.
--
Markus Laire 'malaire' <[EMAIL PROTECTED]>
On 31 Oct 2002 at 16:04, Brent Dax wrote:
> Markus Laire:
> # Emacs and vim also works on Windows, not just UNIX.
>
> So does DOS 'edit'. That doesn't mean Windows users use it. Windows
> users want tools that look and act like Windows tools--if they didn
I don't know of a XIM
> implementation for general Unicode. (Although if you log into your
> Unix machine using Kermit-95, it has a keystroke sequence for
> arbitrary Unicode input).
Emacs and vim also works on Windows, not just UNIX.
--
Markus Laire 'malaire' <[EMAIL PROTECTED]>
ä jaettuna kaksi
At least it wouldn't harm anyone to allow this.
--
Markus Laire 'malaire' <[EMAIL PROTECTED]>
On 30 Oct 2002 at 15:24, Jonathan Scott Duff wrote:
> On Wed, Oct 30, 2002 at 11:10:54PM +0200, Markus Laire wrote:
> > If we are going to do math with ranges, we definitely need non-
> > discreet ranges also. Or at least make sure it's easy enough to
> > implement
as a backup for those
unfortunates who can't use «+» - like ^[+]
What are the good reasons not to use «» ?
--
Markus Laire 'malaire' <[EMAIL PROTECTED]>
.10)?
>
> And what would ('a' .. 'z') - 1 mean?
If we are going to do math with ranges, we definitely need non-
discreet ranges also. Or at least make sure it's easy enough to
implement as a class.
(1.9 .. 2.1) + (5..7) * (72.49 .. 72.51);
--
Markus Laire 'malaire' <[EMAIL PROTECTED]>
On 29 Oct 2002 at 11:22, Jonathan Scott Duff wrote:
> On Tue, Oct 29, 2002 at 10:13:39AM +0200, Markus Laire wrote:
> > Also the idea of allways using 'function' style for something so
> > basic like superpositions doesn't appeal to me.
>
> Superpositions are
; especially seems to be superficial, as it's
just 'this or that' operation in this case, and so single operator
fits perfectly.
Also the idea of allways using 'function' style for something so
basic like superpositions doesn't appeal to me. Of course this might
just
that I've not paid alot of attention to this
> >thread...but does that mean 0x1234 and 01234 (octal) go away or is
> >this an omission?
>
> While we're at it, maybe we can add in 0rMCM to allow roman numerals
> too... --
What about specifying endiannes also, or wo
' very well.
What about
Perl 5: /(.*?)(?:union|$)/
Perl 6: /(.*?) [union | $$]/
or if you want to exlude 'union' from match
Perl 5: /(.*?)(?=union|$)/
Perl 6: /(.*?) [ | $$]/
IMHO those should scan string one char at a time until 'union' or end-
of-string, which is optimal solution.
--
Markus Laire 'malaire' <[EMAIL PROTECTED]>
And the one best reason I forgot to include:
How do you do C< ($a + $b) * $c > if parentheses are forbidden for
mathematical expressions?
--
Markus Laire 'malaire' <[EMAIL PROTECTED]>
On 22 Sep 2002 at 21:06, Simon Cozens wrote:
> [EMAIL PROTECTED] (Markus Laire) writes:
> > While and don't follow same syntax, I don't really see
> > any better solutions.
>
> is sufficiently "hard" that it musn't be confused with the
&g
o be a lot easier to remember than :,:],:> - and
also easier to type.
While and don't follow same syntax, I don't really see
any better solutions. Better solution should IMHO keep :,::,::: and
offer better alternative only to .
doesn't really belong to this serie as it's
ny single values in parentheses. Latest Perl-Golf tournament
'Infix to RPN' used testcases like
(18*16*16*5-1+12+15+18*1-8+6/7-6-2-(19)*(17))+8+((9/14))
This is valid mathematical expression in perl5 but would do something
totally different in perl6 because of those 'one-element lists'
--
Markus Laire 'malaire' <[EMAIL PROTECTED]>
;+>? Why not make it C<|>?
>
> $foo = rx/ <||[cde]>|f /
Because it's good to have MTOWTDI. (= More than one way to do it)
--
Markus Laire 'malaire' <[EMAIL PROTECTED]>
r captures
to $1..$4 but only to $1,$2 according to the renumbering.
Note that it's actually called 'reordering/renumbering' instead of
'binding' in A5 for numeric variables.
--
Markus Laire 'malaire' <[EMAIL PROTECTED]>
s I understand it, binding to $1 etc.. is a special case. Also I
don't see any problems in your example:
m: w / $2:=(\S+) = $1:=(\S+) /
First () is captured and assigned to $2 (instead of $1).
Then second () is captured and assigned to $1.
--
Markus Laire 'malaire' <[EMAIL PROTECTED]>
torial-problem from last Perl Golf
working in perl6, and it has proven to be quite a challenge...
(only 32bit numbers, modulo not fully working, no capturing regexps,
)
And I'm definitely going to try any future PerlGolf challenges also
in perl6.
--
Markus Laire 'malaire' <[EMAIL PROTECTED]>
(OK)
o backtrack fails whole match
So even shorter version:
:/::/:::/ makes backtrack fail current atom/group/rule/match.
--
Markus Laire 'malaire' <[EMAIL PROTECTED]>
r A
or a match for B.
* Closure - zero or more matches for a pattern
So regular expressions in Perl are really far from being regular.
for technical definition, you can check e.g.
http://www.wkonline.com/d/Finite_State_Machine.html
but that is most likely not understandable without prior knowlegde.
--
Markus Laire 'malaire' <[EMAIL PROTECTED]>
ck into.
* This is useful for throwing away successfully processed input when
matching from an input stream or an iterator of arbitrary length.
--
Markus Laire 'malaire' <[EMAIL PROTECTED]>
$x :: $i }
as ?: operator is changed in Perl6.
--
Markus Laire 'malaire' <[EMAIL PROTECTED]>
85 matches
Mail list logo