: [EMAIL PROTECTED] (Luke Palmer) writes:
:
:
: I would hope the former. However, what about this compile-time
: integral power macro[1]?
:
:macro power ($x, $p) {
:if $p 0 {
:{ $x * power($x, $p-1) }
:}
:else {
:{ 1 }
:}
:}
Luke Palmer [EMAIL PROTECTED] writes:
Alex Burr writes:
In theory you could write one as a perl6 macro, although it would be
more convenient if there was someway of obtaining the syntax tree of a
previously defined function other than quoting it (unless I've missed
that?).
There is a
Austin Hastings [EMAIL PROTECTED] writes:
--- Luke Palmer [EMAIL PROTECTED] wrote:
Alex Burr writes:
But I confidently predict that no-one with write a useful
partial evaluator for perl6. The language is simply too big.
Then again, there are some very talented people with a lot of free
On Mon, 15 Sep 2003, Piers Cawley wrote:
Luke Palmer [EMAIL PROTECTED] writes:
Alex Burr writes:
In theory you could write one as a perl6 macro, although it would be
more convenient if there was someway of obtaining the syntax tree of a
previously defined function other than quoting it
--- Austin Hastings [EMAIL PROTECTED] wrote:
--- Luke Palmer [EMAIL PROTECTED]
wrote:
Then again, there are some very talented people
with a lot of free
time in the Perl community; I wouldn't count it
out.
That looked to me like a Damian troll, hoping that
DC would pop up
and
[EMAIL PROTECTED] (Luke Palmer) writes:
I would hope the former. However, what about this compile-time
integral power macro[1]?
macro power ($x, $p) {
if $p 0 {
{ $x * power($x, $p-1) }
}
else {
{ 1 }
}
}
That would
Alex Burr writes:
In theory you could write one as a perl6 macro, although it would be
more convenient if there was someway of obtaining the syntax tree of a
previously defined function other than quoting it (unless I've missed
that?).
There is a large class of cool optimizations possible
Alex Burr wrote:
[EMAIL PROTECTED] (Luke Palmer) writes:
I would hope the former. However, what about this compile-time
integral power macro[1]?
macro power ($x, $p) {
if $p 0 {
{ $x * power($x, $p-1) }
}
else {
{ 1 }
}
}
That would
--- Luke Palmer [EMAIL PROTECTED] wrote:
Alex Burr writes:
But I confidently predict that no-one with write a useful
partial evaluator for perl6. The language is simply too big.
Then again, there are some very talented people with a lot of free
time in the Perl community; I wouldn't
While we seem to be on the subject of hashing out macro semantics,
here's a question I've had awhile.
What do macros do about being passed variables?
Let's say I make a Csquare macro:
macro square ($x) {
{ $x * $x }
}
And then I have code.
my $var = 10;
print square
On Sat, Aug 02, 2003 at 01:18:01PM -0600, Luke Palmer wrote:
: While we seem to be on the subject of hashing out macro semantics,
: here's a question I've had awhile.
:
: What do macros do about being passed variables?
:
: Let's say I make a Csquare macro:
:
: macro square ($x) {
:
Larry Wall wrote:
[snip]
Nope. $x and $p are syntax trees.
blink
Macros are passed syntax trees as arguments, but return coderefs?
That's... odd.
I would expect that a macro would be expected to *return* a syntax
tree... which could then undergo (more) macro-expansion.
Sortof like how in
Larry Wall wrote:
[snip]
Nope. $x and $p are syntax trees.
blink
Macros are passed syntax trees as arguments, but return coderefs?
That's... odd.
I would expect that a macro would be expected to *return* a syntax
tree... which could then undergo (more) macro-expansion.
Keep in
13 matches
Mail list logo