Skip Menu |

This queue is for tickets about the Promises CPAN distribution.

Report information
The Basics
Id: 84024
Status: resolved
Priority: 0/
Queue: Promises

People
Owner: Nobody in particular
Requestors: dgl [...] dgl.cx
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: "when" syntax not valid with modern Perl syntax
Date: Mon, 18 Mar 2013 07:50:23 -0700
To: bug-Promises [...] rt.cpan.org
From: David Leadbeater <dgl [...] dgl.cx>
The following gives a syntax error: #!perl use 5.010; use Promises qw[ when deferred ]; when(deferred->resolve)->then(sub { print "hi" }); Using Promises::when as a workaround works. I think it should at least be pointed out in the docs (and maybe an alternate verb should be provided, ideally deprecating the abuse of "when").
Subject: Re: [rt.cpan.org #84024] "when" syntax not valid with modern Perl syntax
Date: Wed, 20 Mar 2013 08:46:08 -0400
To: bug-Promises [...] rt.cpan.org
From: Stevan Little <stevan.little [...] iinteractive.com>
David, Wow, I can't believe I didn't think of this. You are right, this will need to be changed. I am open to an alternate name for 'when', do you have any suggestions? Thanks, - Stevan On Mar 18, 2013, at 10:51 AM, David Leadbeater via RT <bug-Promises@rt.cpan.org> wrote: Show quoted text
> Mon Mar 18 10:51:09 2013: Request 84024 was acted upon. > Transaction: Ticket created by DGL > Queue: Promises > Subject: "when" syntax not valid with modern Perl syntax > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: dgl@dgl.cx > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=84024 > > > > The following gives a syntax error: > > #!perl > use 5.010; > use Promises qw[ when deferred ]; > when(deferred->resolve)->then(sub { print "hi" }); > > Using Promises::when as a workaround works. I think it should at least be > pointed out in the docs (and maybe an alternate verb should be provided, > ideally deprecating the abuse of "when"). >
Subject: Re: [rt.cpan.org #84024] "when" syntax not valid with modern Perl syntax
Date: Wed, 28 Aug 2013 14:41:45 +1000
To: bug-Promises [...] rt.cpan.org
From: Daniel Carosone <daniel.carosone [...] gmail.com>
Show quoted text
> I am open to an alternate name for 'when', do you have any suggestions?
collect as in "collect (@promises)->then(...)". However, that has a potential collision with AnyEvent::Collect which uses it for somewhat similar purposes. So, I prefer one of: stipulate, speculate, venture By the way, I love the module - I hope work on it hasn't been forgotten! :) -- Dan.
Any chance this can be fixed in, say, the next week? I was about to use this module in a book I'm writing right now, and all the samples in my book contains "use 5.14.2" which totally clashes with the use of "when" :)
Subject: Re: [rt.cpan.org #84024] "when" syntax not valid with modern Perl syntax
Date: Thu, 17 Oct 2013 07:49:43 -0400
To: bug-Promises [...] rt.cpan.org
From: Stevan Little <stevan.little [...] iinteractive.com>
Whoops, sorry, forgot about this issue. Yes, I can release a new version that has the collect method and deprecates the when method. - Stevan On Oct 17, 2013, at 2:24 AM, "Daisuke Maki via RT" <bug-Promises@rt.cpan.org> wrote: Show quoted text
> Queue: Promises > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=84024 > > > Any chance this can be fixed in, say, the next week? I was about to use this module in a book I'm writing right now, and all the samples in my book contains "use 5.14.2" which totally clashes with the use of "when" :)
This has been fixed in 0.04, I went with collect because it makes the most sense and it doesn't conflict with any keywords. Right now 'when' will warn when imported.