Re: Synchronized / Thread syntax in Perl 6

2006-05-31 Thread Benjamin Smith
On Tue, May 30, 2006 at 03:41:06PM -0600, John Drago wrote:
> class Foo is synchronized {
>   ...
> }
> 
> our method Bar is synchronized {
>   ...
> }
> 
> class Baz {
>   has $.Bux is synchronized;
> }

To everyone participating in this thread:
There has already been a draft spec for concurrency written, please see
http://svn.perl.org/perl6/pugs/trunk/docs/Perl6/Spec/Concurrency.pod .

It suggests "is critical;" for the first, and second, but I can't see
anything like the third.   It also suggests that Perl6 will have
transactions and so will also have "is atomic".

(There's a Google Summer of Code project to add software transactional
memory primitives to parrot.)

-- 
Benjamin Smith <[EMAIL PROTECTED], [EMAIL PROTECTED]>


Re: new sigil

2005-10-25 Thread Benjamin Smith
On Tue, Oct 25, 2005 at 02:02:58PM -0500, Jonathan Scott Duff wrote:
> On Tue, Oct 25, 2005 at 12:18:41PM -0600, Luke Palmer wrote:



> I don't think so. In the first example all the T (or ¢T) are the same
> type after the first ¢T (where the type is bound). In the second one
> you'd get two separate types ¢T and ¢U. But ¢U would probably get bound
> to the same type as ¢T as that's the type of thing that it returns
> (assuming perl can figure that out).

We have (or have had?) parameterised classes where you can specify
parameters to the class enclosed in [].

eg. class Foo[...] { ... }

So couldn't the same be used for functions?  This way you wouldn't need
a special sigil for classes declared in such a way.

sub foo[Bar] (Bar $tab) { ... }

Since perl6 isn't really a static language, I don't think you need to be
allowed to have non-type variables in the [] (dependent-typing, or where
you can use primitive types like int in template parameters in C++),
since being parameters in [] means only that they're types, and not that
they are always bound at compile time.

(apologies for breaking the unicode)

-- 
Benjamin Smith <[EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]>
Christ's College - Mathematics Part 1B
IRC: integral on irc.perl.org, and irc.freenode.net (channel: #perl)


Re: $1 change issues [was Re: syntax for accessing multiple versions of a module]

2005-10-21 Thread Benjamin Smith
On Thu, Oct 20, 2005 at 06:39:34PM -0600, Luke Palmer wrote:
> On 10/20/05, Nate Wiger <[EMAIL PROTECTED]> wrote:
> > Luke Palmer wrote:
> > > The fact that we use . instead of -> (like every other language on
> > > the planet)?
> >
> > You're using my argument for me - thanks. See above.
> 
> Huh?   So you want to go back to Perl 5's arrow?  *Anybody* coming to
> Perl 6 from some non-Perl 5 language is going to be more comfortable
> with dot.

Unless it was Smalltalk, C++, Haskell etc.

I really wish people wouldn't use the argument that . is used for method
calls everywhere.  It's not.

Surely we have a much better argument in what we used -> for instead?

> > > [1] Which will be, what, eight hours for a Perl 5 programmer?  Have
> > > you ever spent a month trying to learn, oh, say, Haskell?  Because
> > > people do that, too.
> >
> > There are more components to this that just the learning time for one
> > person. There are project teams, sustaining engineering for existing
> > projects, etc. And that's not even counting management tape. Real-world,
> > profitable computing is a big, ugly, nasty beast.

Basically that would mean that any team would never be able to change
language, right?  So there would be no difference if we wanted them to
change to Perl 5, Perl 6 or Haskell, so it doesn't seem very useful to
argue about this.

-- 
Benjamin Smith <[EMAIL PROTECTED], [EMAIL PROTECTED]>


!!/nor and ??!! vs. ??::

2005-09-08 Thread Benjamin Smith
Pugs currently implements &infix: as an ugly version of the
&infix: operator.

Are these in the spec?

If so, how does !!  interact with the second part of the new ??!!
replacement for ??:: ?

-- 
Benjamin "integral" Smith <[EMAIL PROTECTED], [EMAIL PROTECTED]>


Re: Perl development server

2005-05-24 Thread Benjamin Smith
On Tue, May 24, 2005 at 11:12:58AM +0100, Benjamin Smith wrote:
>   * svk
>   * vim
>   * screen
>   * cron

  * haddock

-- 
Benjamin Smith <[EMAIL PROTECTED], [EMAIL PROTECTED]>


pgp2GkG7fEUxQ.pgp
Description: PGP signature


Re: Perl development server

2005-05-24 Thread Benjamin Smith
On Mon, May 23, 2005 at 05:25:57PM +0200, Juerd wrote:
> Rob Kinyon skribis 2005-05-23 11:22 (-0400):
> > I'd like one.
> 
> Sure - just think of a nice catchy username! :)

I'd like "bsmith".   Thanks :-)

> > Maybe we should divvy these tasks out. It wouldn't do that have two
> > people smoke-testing on the exact same machine or to have two SVN
> > mirrors ...
> 
> Good idea, will you take the task of managing these decisions?

I'd like to volunteer to setup the SVN/SVK mirror.

Software wise can I ask for: 

  * svk
  * vim
  * screen
  * cron

-- 
Benjamin Smith <[EMAIL PROTECTED], [EMAIL PROTECTED]>


pgp9T8BkiKhuw.pgp
Description: PGP signature


BEGIN and lexical variables inside subroutines

2005-05-12 Thread Benjamin Smith
  sub foo { my $x; BEGIN { $x = 3 }; say $x }
  foo; foo; foo;

Currently in perl5 and pugs this prints "3\n\n\n".

Should BEGIN blocks be able to modify values in lexical variables that
don't really exist yet? (People can use state after all to get a
variable which does exist early enough for them to modify.)


Is there some kind of "prototype pad" (and lexicals) available inside
the BEGIN block, rather than a full runtime pad?

-- 
Benjamin Smith <[EMAIL PROTECTED], [EMAIL PROTECTED]>


pgpRkLbUAMFJ0.pgp
Description: PGP signature