On Fri, Aug 19, 2005 at 01:36:30AM +0800, Autrijus Tang wrote:
> BEGIN {
> &foo := a Sub is stub {
> ($a) := &?Internals::GETARGS();
> $a = 1 unless exists $a;
> # real body begins here
> ...
> };
> }
Er, sorry, the ($a) would need a my()
On Fri, Aug 19, 2005 at 01:36:30AM +0800, Autrijus Tang wrote:
: On Thu, Aug 18, 2005 at 10:26:00AM -0700, Larry Wall wrote:
: > Sure. Though it probably also wants to stay as metadata associated
: > with the signature, since part of the reason for putting it in
: > the signature in the first plac
On Thu, Aug 18, 2005 at 10:26:00AM -0700, Larry Wall wrote:
> Sure. Though it probably also wants to stay as metadata associated
> with the signature, since part of the reason for putting it in
> the signature in the first place is so that optimizers can install
> constants on the caller end, at l
On Fri, Aug 19, 2005 at 01:17:51AM +0800, Autrijus Tang wrote:
: Also, preemptively -- I think the corresponding "delete $a" is insane,
: as it would just lift up the constancy problem one level, defeating the
: no rebinding restriction.
I think in general the only time you're allowed to monkey wi
On Fri, Aug 19, 2005 at 01:15:23AM +0800, Autrijus Tang wrote:
: On Thu, Aug 18, 2005 at 10:09:16AM -0700, Larry Wall wrote:
: > In other words, you could desugar
: >
: > sub foo ($a = 1) {...}
: >
: > to
: >
: > sub foo ($a) {
: > $a = 1 unless exists $a;
: > ...
: > }
:
:
On Fri, Aug 19, 2005 at 01:15:23AM +0800, Autrijus Tang wrote:
> On Thu, Aug 18, 2005 at 10:09:16AM -0700, Larry Wall wrote:
> > In other words, you could desugar
> >
> > sub foo ($a = 1) {...}
> >
> > to
> >
> > sub foo ($a) {
> > $a = 1 unless exists $a;
> > ...
> > }
>
>
On Thu, Aug 18, 2005 at 10:09:16AM -0700, Larry Wall wrote:
> In other words, you could desugar
>
> sub foo ($a = 1) {...}
>
> to
>
> sub foo ($a) {
> $a = 1 unless exists $a;
> ...
> }
I like this. Can we go for it, at least for this week? :)
Thanks,
/Autrijus/
pgpj
On Wed, Aug 17, 2005 at 05:31:12PM +, [EMAIL PROTECTED] wrote:
: Not only that, but what if what I want is a named constnat undef value?
If we went with "bind once" rather than "write once" semantics then after
my $foo is readonly := undef;
$foo could not be rebound, but saying
my $
--
Mark Biggar
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]> On Wed, Aug 17, 2005 at 08:47:18AM -0700, Larry Wall wrote:
> > : >That could be made to work by defining constant to mean you can assign
> > : >to it if it's undefined. But then it gets a little harder to reason
> > : >about
Larry Wall wrote:
> On Wed, Aug 17, 2005 at 01:56:35PM +1000, Adam Kennedy wrote:
> :
> : >: If not a special form, should this work?
> : >:
> : >: my $pi is constant;
> : >: $pi = 3;
> : >
> : >That could be made to work by defining constant to mean you can assign
> : >to it if it's und
On Wed, Aug 17, 2005 at 09:37:08PM +, Luke Palmer wrote:
: On 8/17/05, Larry Wall <[EMAIL PROTECTED]> wrote:
: > You could still reason about it if you can determine what the initial
: > value is going to be. But certainly that's not a guarantee, which
: > is one of the reasons we're now calli
On 8/17/05, Larry Wall <[EMAIL PROTECTED]> wrote:
> You could still reason about it if you can determine what the initial
> value is going to be. But certainly that's not a guarantee, which
> is one of the reasons we're now calling this write/bind-once behavior
> "readonly" and moving true constan
On Thu, Aug 18, 2005 at 12:02:53AM +0800, Autrijus Tang wrote:
: On Wed, Aug 17, 2005 at 08:47:18AM -0700, Larry Wall wrote:
: > : >That could be made to work by defining constant to mean you can assign
: > : >to it if it's undefined. But then it gets a little harder to reason
: > : >about it if $
On Wed, Aug 17, 2005 at 08:47:18AM -0700, Larry Wall wrote:
> : >That could be made to work by defining constant to mean you can assign
> : >to it if it's undefined. But then it gets a little harder to reason
> : >about it if $pi can later become undefined. I suppose we could
> : >disallow undefi
On Wed, Aug 17, 2005 at 01:56:35PM +1000, Adam Kennedy wrote:
:
: >: If not a special form, should this work?
: >:
: >: my $pi is constant;
: >: $pi = 3;
: >
: >That could be made to work by defining constant to mean you can assign
: >to it if it's undefined. But then it gets a little h
: If not a special form, should this work?
:
: my $pi is constant;
: $pi = 3;
That could be made to work by defining constant to mean you can assign
to it if it's undefined. But then it gets a little harder to reason
about it if $pi can later become undefined. I suppose we could
dis
as a subtype.
: my macro pi { 3 };
: my &pi = { 4 };
Those both live in the function namespace, as would the new constant
declarator if we include the sigilless form above .
: The form
:
: my $pi is constant = 3;
:
: to me bears the disadvantage, that it doesn't look li
On Thu, Aug 11, 2005 at 09:52:18PM -0700, Ashley Winters wrote:
: On 8/11/05, Larry Wall <[EMAIL PROTECTED]> wrote:
: > So either we have to bifurcate the concept into "temporarily constant"
: > and "permanently constant", or we force people to distinguish with ::=
: > (or "is constant('foo')"), or
doesn't hurt
my macro pi { 3 };
my &pi = { 3 };
BTW, are all these competing for the same name slot or can
some or all exist in parallel? Can they if the type is the
same but not for
my ::pi ::= 1;
my enum ;
my macro pi { 3 };
my &pi = { 4 };
The form
On 8/11/05, Larry Wall <[EMAIL PROTECTED]> wrote:
> So either we have to bifurcate the concept into "temporarily constant"
> and "permanently constant", or we force people to distinguish with ::=
> (or "is constant('foo')"), or we make some representations about the
> requirement for the compiler t
On Fri, Aug 12, 2005 at 01:43:43AM +0800, Autrijus Tang wrote:
: On Wed, Aug 10, 2005 at 12:41:17PM -0700, Larry Wall wrote:
: > : If yes, what does it desugar to?
: > :
: > : my $pi is constant := 3;
: > : my $pi is constant ::= 3;
: >
: > In this case it desugars to
:
On Wed, Aug 10, 2005 at 12:41:17PM -0700, Larry Wall wrote:
> : If yes, what does it desugar to?
> :
> : my $pi is constant := 3;
> : my $pi is constant ::= 3;
>
> In this case it desugars to
>
> my $pi is constant = 3;
>
> :-)
However, I wonder if th
On Wed, Aug 10, 2005 at 11:48:16PM +0200, TSa wrote:
: Only that ?$b is not marked is constant? Strange that is.
Straight out of the apocalypse--parameters default to constant.
Larry
HaloO,
Larry Wall wrote:
In this case it desugars to
my $pi is constant = 3;
:-)
In other words the assignment to a my turns into an ordinary assignment
that happens at runtime. Hopefully, since $pi is marked constant,
it could be optimized to a binding in many cases, but that's no
On Thu, Aug 11, 2005 at 02:22:04AM +0800, Autrijus Tang wrote:
: According to S06:
:
: my $pi is constant = 3;
Perhaps the actual rewrite is
my $pi is constant({ 3 });
much like
state $where = $California;
is desugared to
state $where is first({$California});
or some such
On Thu, Aug 11, 2005 at 02:22:04AM +0800, Autrijus Tang wrote:
: According to S06:
:
: my $pi is constant = 3;
:
: Is this a special form?
I believe any assignment to a declarator is potentially a special form,
or we can't get assignment to "has" and "state" to wo
According to S06:
my $pi is constant = 3;
Is this a special form? If yes, what does it desugar to?
my $pi is constant := 3;
my $pi is constant ::= 3;
If not a special form, should this work?
my $pi is constant;
$pi = 3;
If yes, should this pass compilation?
my $pi
27 matches
Mail list logo