Re: Macros?

2006-01-29 Thread Herbert Snorrason
On 29/01/06, Yuval Kogman <[EMAIL PROTECTED]> wrote:
> Basically the plan is that when an internal AST language is decided
> upon, the macros will be able to get either the source code text, or
> an AST.
Two things. First, if the AST path is taken, doesn't that mean that
the AST representation has to be compatible between implementations
(assuming there'll be more than one)? Secondly, there's ease of use.
ASTs are, at least from what I've seen, pretty verbose. Aren't we
trying to make things easy for the programmer? With source text, doing
manipulations by hand can be a bother, so that's no solution either...

Maybe I'm spoiled by the idea of s-expressions, though. But I get the
impression that lispy macros are where the idea comes from...
--
Schwäche zeigen heißt verlieren;
härte heißt regieren.
  - "Glas und Tränen", Megaherz


Macros?

2006-01-29 Thread Herbert Snorrason
Perl6 will have macros. Good. Cool. But, sadly, that seems to be close
to the most specific thing anyone says about the subject. There is
some further discussion in Apocalypse & Exegesis 6, but nothing in the
Synopsis.

Now, considering that macros are a language feature and that the
Synopses are presented as the language spec, I wonder if there
shouldn't be something there. Exactly what, though, I won't pretend to
know. :)
--
Schwäche zeigen heißt verlieren;
härte heißt regieren.
  - "Glas und Tränen", Megaherz


Re: (OT) Re: Perl development server

2005-05-24 Thread Herbert Snorrason
On 24/05/05, Michele Dondi <[EMAIL PROTECTED]> wrote:
> Incidentally, would 'laukurdottir' be a proper Icelandic offence? :-)

It'd be 'lauksdóttir' (due to declension) and mean 'daughter of an
onion'. If nothing else, it would make people look at you in a funny
way... ;)

-- 
Schwäche zeigen heißt verlieren;
härte heißt regieren.
  - "Glas und Tränen", Megaherz


Re: (OT) Re: Perl development server

2005-05-24 Thread Herbert Snorrason
Icelandic: laukur (Incidentally, none of you will ever guess how to
correctly pronounce that.)

-- 
Schwäche zeigen heißt verlieren;
härte heißt regieren.
  - "Glas und Tränen", Megaherz


Re: Plethora of operators

2005-05-14 Thread Herbert Snorrason
On 14/05/05, Damian Conway <[EMAIL PROTECTED]> wrote:
> Here are a few of the things I'll be using reductions for in Perl 6...
> 
>  1. To add things up:
> 
> $sum = [+] @amounts;
> 
>  2. To calculate the probability that I'll need to use a reduction today:
> 
> $final_prob = [*] @independent_probs;
> 
>  3. To drill down a hierarchical data structure, following the path
> specified by a list of keys:
> 
> $leaf_value = [.{}] %hash, @keys;
> 
>  4. To compute RMS values:
> 
> $RMS = sqrt [+] @samples »** 2
> 
>  5. To take the dot product of two vectors:
> 
> $dot_prod = [+] @vec1 »*« @vec2;
> 
>  6. As a cleaner form of C<< join.assuming(:sep<>) >>:
> 
> $joined = [~] @strings;
> 
>  7. For parity checking a bitset:
> 
> $parity = [?^] @bits;
> 
>  8. To verify the monotonicity of a sequence:
> 
> $is_monotonic = [<] @numbers;
> 
>  9. To retrieve the first defined value in a list:
> 
> $first_def = [//] @list;
> 
>  10. To apply a series of properties to a value:
> 
> $propped = [but] $value, @properties;
And I note that each of these is a 'simple' operator inside the
reduce. I think the complex example earlier in this thread ([»+^=«],
warranted by the context, but still extreme) may give the wrong
picture of the 'new' metaoperator. The point is that although it opens
marvellous new ways of obfuscation, it's also extremely handy when
used properly. And that's something shared by many of Perl's existing
features.

> Personally I think a metaoperator with that many uses is more than Swiss-Army
> enough to be in the core of Perl 6.
So now it's going from Swiss-army chainsaw to Swiss-army atomic fusion bomb?

-- 
Schwäche zeigen heißt verlieren;
härte heißt regieren.
  - "Glas und Tränen", Megaherz


Re: use less in perl6?

2005-03-30 Thread Herbert Snorrason
On Wed, 30 Mar 2005 08:56:58 -0500, Matt Fowles <[EMAIL PROTECTED]> wrote:
> On Wed, 30 Mar 2005 08:48:55 -0500, Aaron Sherman <[EMAIL PROTECTED]> wrote:
> > use less syntax;
> Back out the entire p6 grammar and put in lisp's instead...
Huh. I suppose that's the only difference these days... ;)

-- 
Schwäche zeigen heißt verlieren;
härte heißt regieren.
  - "Glas und Tränen", Megaherz


Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-04 Thread Herbert Snorrason
On Sat, 4 Dec 2004 01:37:00 -0800, Larry Wall <[EMAIL PROTECTED]> wrote:
> for =$*IN {...}
> for =$*ARGS {...}
Yay. A generalised form of the input operator, which can create even
handier idioms for simple file processing. Maybe I wasn't clear
enough. My issue wasn't specifically with '.lines' for filter
behaviour -- as a replacement solely for the while (<>) { ... } idiom,
it would be quite adequate. But as a replacement for , it
is (IMO) sub-par, and definitely does add to the length of the whole.

As for the "nuclear blackmail" argument: One of the prime reasons I
like Perl is that different things look different. When everything
starts looking like a method call, that distinction rapidly drops
away.

> $file = =;
Huh. That's really kinda neat.

> But here's the kicker.  The null filename can again represent the
> standard filter input, so we end up with Perl 5's
> 
> while (<>) {...}
> 
> turning into
> 
> for =<> {...}
Which is really short for 'for [EMAIL PROTECTED] {...}', then?

-- 
Schwäche zeigen heißt verlieren;
härte heißt regieren.
  - "Glas und Tränen", Megaherz


Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-03 Thread Herbert Snorrason
This whole issue kind of makes me go 'ugh'. One of the things I like
best about Perl is the amazing simplicity of the <> input construct.
Replacing that with something that not only is object oriented, but on
top of that also LOOKS object oriented is bound to be a loss. It's
going to be that bit longer to write, and not the least bit easier to
understand. Neither the conceptual "input operator" nor the extremely
handy idiom for "behave like a Unixy filter" should go. Please.

If you don't like the angles doing it, by all means take them. But
don't push that far into OO land. There's a reason we aren't all using
Python and Ruby by now.
-- 
Schwäche zeigen heißt verlieren;
härte heißt regieren.
  - "Glas und Tränen", Megaherz


Re: Will _anything_ be able to truly parse and understand perl?

2004-11-25 Thread Herbert Snorrason
On Thu, 25 Nov 2004 22:00:03 +1100, Adam Kennedy <[EMAIL PROTECTED]> wrote:
> And just after the snip you will see I qualify "parse" in this context
> as loading the perl in some form of DOM-type tree.
And yet you disqualify the Perl6 rule system, with its tree of match
objects? What, exactly, is it that you want?

-- 
Schwäche zeigen heißt verlieren;
härte heißt regieren.
  - "Glas und Tränen", Megaherz


Re: S5 updated

2004-09-25 Thread Herbert Snorrason
On Fri, 24 Sep 2004 19:46:37 -0700, Edward Peschko <[EMAIL PROTECTED]> wrote:
> You could even say that in the chinese case that if you have
> 
> "?$B#3" --> 3 --> "3"
> 
> that's a bug. It had *better* turn back into "?$B#3" when you do
> the int to string conversion.  That's a internationalization snafu
> if you don't.
Shouldn't that more likely depend on the locale, in some way? That
way, the chinese could use their numbers, but still have it print out
legibly in Europe/America...

-- 
Schwäche zeigen heißt verlieren;
härte heißt regieren.
  - "Glas und Tränen", Megaherz


Re: attributes/methods on sigils?

2004-09-21 Thread Herbert Snorrason
Now you're underusing smileys. I hope.

On Tue, 21 Sep 2004 12:04:01 -0700, Larry Wall <[EMAIL PROTECTED]> wrote:
> On Tue, Sep 21, 2004 at 01:49:07PM +0200, Michele Dondi wrote:
> : I fear, and with good reasons, that this may be too wild a case of an
> : extremization, but I wonder wether, just like for example strings are
> : implemented by means of special (quote-like) operators, sigils, instead of
> : being syntactical creatures could be (sort of special) operators
> : themselved and thus allow attributes/methods or even adverbs...
> 
> We can do better than that--let's just define every Unicode character
> to be an object with various roles and attributes, and the roles of
> each character tell how to parse it in any context and what it means
> in that role.  Then we add all these object characters to Intercal,
> and we're done.
> 
> Larry
> 

-- 
Schwäche zeigen heißt verlieren;
härte heißt regieren.
  - "Glas und Tränen", Megaherz


Re: [S3, S4, S5]: =~ becomes ~~

2004-09-16 Thread Herbert Snorrason
> Okay, it ought to be there soon.  I added it in the "New operators"
> section, since it's pretty different from =~.
That'd also be appropriate, but I didn't see an explicit mention anywhere...

> Arguably the ~~ table should go in S3 instead of S4.
It most likely should, since ~~ is an operator, despite the origin of
the tables...
-- 
Schwäche zeigen heißt verlieren;
härte heißt regieren.
  - "Glas und Tränen", Megaherz


[S3, S4, S5]: =~ becomes ~~

2004-09-15 Thread Herbert Snorrason
I know that, you know that ... but the synopses never actually say it.
It's evident from context, but it's never said explicitly. I would
*think* that should be in the "Operator renaming" section of S3, and
presume this is an oversight?
--
Schwäche zeigen heißt verlieren;
härte heißt regieren.
  - "Glas und Tränen", Megaherz


Re: S4: Can PRE and POST be removed from program flow?

2004-09-06 Thread Herbert Snorrason
As it stands, though, perl6-internals isn't about perl, but Parrot ...
so of the two lists, language is arguably more appropriate...


On Sun, 5 Sep 2004 22:37:04 -0400, Matt Diephouse <[EMAIL PROTECTED]> wrote:
> I may be completely off base here, but I think this whole discussion
> would be better suited for perl6-internals. A packaging system would
> not be a feature of the language itself, but of its implementation.
> Don't confuse Perl and perl.
> 
> --
> matt
> 



-- 
Schwäche zeigen heißt verlieren;
härte heißt regieren.
  - "Glas und Tränen", Megaherz