Thread Wow! (Promise Syntax) (41 answers)
Opened by Kuerbis at 2015-08-29 19:50

Linuxer
 2015-08-31 22:26
#181979 #181979
User since
2006-01-27
3870 Artikel
HausmeisterIn

user image
2015-08-31T20:12:04 Raubtier
Aha, nach start kann man suchen: http://doc.perl6.org/routine/start. Das gibt ein Promise zurück -> http://doc.perl6.org/type/Promise. Allerdings verstehe ich schon gleich den nächsten Satz in der Doku nicht: "Returns a promise that will be kept with a Proc::Status object once the external program exits...".


Der zitierte Satz gehört aber zum Abschnitt von Proc::Async und nicht zum Abschnitt von Promise.

http://doc.perl6.org/routine/start
class Proc::Async

From Proc::Async
method start

method start(Proc::Async:D:, :$scheduler = $*SCHEDULER, :$cwd = $*CWD) returns Promise:D

Initiates spawning of the external program. Returns a promise that will be kept with a Proc::Status object once the external program exits, and that will be broken if the program cannot be started.

If start is called on a Proc::Async object on which it has already been called before, an exception of type X::Proc::Async::AlreadyStarted is thrown.
...


Proc::Async verwendet also intern Promise... Inwieweit das aber nun beim Verständnis von Promise helfen soll, versteh ich wiederum nicht ;-)

Sollten wir zum Verstehen von Promise nicht erstmal bei diesem bleiben und den zweiten Treffer von http://doc.perl6.org/routine/start verwenden?

Oder versteh ich als Perl6-Abstinenzler Dich da falsch?
meine Beiträge: I.d.R. alle Angaben ohne Gewähr und auf Linux abgestimmt!
Die Sprache heisst Perl, nicht PERL. - Bitte Crossposts als solche kenntlich machen!

View full thread Wow! (Promise Syntax)