Skip to content

Commit

Permalink
Add a lambda function that just returns its arguments. Clean up sever…
Browse files Browse the repository at this point in the history
…al test failures
  • Loading branch information
tene committed Jul 25, 2009
1 parent 8f8f5d6 commit e6bea57
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
9 changes: 9 additions & 0 deletions src/builtins/control.pir
Expand Up @@ -15,6 +15,15 @@ src/builtins/control.pir - Cardinal Control functions
.include 'except_types.pasm'
.include 'except_severity.pasm'

=item lambda

=cut

.sub 'lambda'
.param pmc block :named('!BLOCK')
.return (block)
.end

=item take

=cut
Expand Down
2 changes: 1 addition & 1 deletion src/classes/Array.pir
Expand Up @@ -190,7 +190,7 @@ Return a sorted copy of the list
=cut

.sub 'sort' :method
.param pmc by :optional
.param pmc by :optional :named('!BLOCK')
.param int has_by :opt_flag
if has_by goto have_by
by = get_hll_global 'infix:cmp'
Expand Down
2 changes: 1 addition & 1 deletion src/classes/Integer.pir
Expand Up @@ -175,7 +175,7 @@ Runs C<block> for integer from 0 to value of C<self>

.include "hllmacros.pir"
.sub 'times' :method
.param pmc block
.param pmc block :named('!BLOCK')
$I0 = 0
$I1 = self
.While($I0 < $I1, {
Expand Down
2 changes: 1 addition & 1 deletion t/99-other.t
Expand Up @@ -17,7 +17,7 @@ end
foo[1].upto(7) { |i| is i, a, "method on array access of the result of calling a function"
a += 1}

a = do |a,&f|
a = lambda do |a,&f|
f(a)
end

Expand Down

0 comments on commit e6bea57

Please sign in to comment.