| 1 | package Dallycot::AST::ListCons; | ||||||||||
| 2 | 29 | our $AUTHORITY = 'cpan:JSMITH'; | |||||||||
| 3 | |||||||||||
| 4 | # ABSTRACT: Compose lambdas into a new lambda | ||||||||||
| 5 | |||||||||||
| 6 | 29 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 29 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 29 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 29 | ▶ | use parent 'Dallycot::AST'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 29 | ▶ | use Promises qw(deferred); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | |||||||||||
| 14 | 29 | my $FunctionURI = Dallycot::Value::URI->new("http://www.dallycot.net/ns/core/1.0#list-cons"); | |||||||||
| 15 | |||||||||||
| 16 | sub execute { | ||||||||||
| 17 | 1 | ▶ | my ( $self, $engine ) = @_; | ||||||||
|
Subroutine
execute: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 18 | |||||||||||
| 19 | 1 | my(@streams) = @$self; | |||||||||
| 20 | |||||||||||
| 21 | 1 | my $value = pop @streams; | |||||||||
| 22 | 1 | ▶ | while(@streams) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | 1 | $value = Dallycot::AST::Apply->new( | |||||||||
| 24 | $FunctionURI, | ||||||||||
| 25 | [ (pop @streams), $value ], | ||||||||||
| 26 | {} | ||||||||||
| 27 | ); | ||||||||||
| 28 | } | ||||||||||
| 29 | 1 | return $engine->execute($value); | |||||||||
| 30 | } | ||||||||||
| 31 | |||||||||||
| 32 | 29 | 1; | |||||||||