Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
implement chr() function, add two ideas to LHF.markdown
  • Loading branch information
moritz committed Jul 1, 2011
1 parent 7cd81b3 commit 14b0d55
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions LHF.markdown
Expand Up @@ -13,3 +13,12 @@ the stat calls should be pretty straight-forward to port from master

## Nil assignment
my Int $b = 3; $b = Nil;

## Built-in functions
Often builtins are only added as methods, even when the corresponding function
should exist. Go through src/core/ and write functions that re-dispatch to the
methods where necessary

## Str.ords

Implement Str.ords and the sub form (returns a list of codepoints)
3 changes: 3 additions & 0 deletions src/core/Int.pm
Expand Up @@ -148,3 +148,6 @@ multi prefix:<+^>(Int \$a) {
nqp::p6box_i(pir::bnot__II(nqp::unbox_i($a)))
}

proto sub chr($) {*}
multi sub chr(Int \$x) { $x.chr }
multi sub chr(Cool \$x) { $x.Int.chr }

0 comments on commit 14b0d55

Please sign in to comment.