This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
sub myMap(&@) { | |
!wantarray && @_ - 1 || @_ > 1 && ( | |
do { | |
local $_ = $_[1]; | |
$_[0]->(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val foo = '€'; | |
implement main () = () | |
(* | |
rsimoes@desktop:~/scratch/ats$ atscc uni_charsassign.dats | |
/usr/lib/ats-anairiats-0.2.5/bin/atsopt --output uni_charsassign_dats.c --dynamic uni_charsassign.dats | |
/home/rsimoes/scratch/ats/uni_charsassign.dats: LEXING ERROR: illegal character at [11(line=1, offs=11)] is unclosed! | |
exit(ATS): uncaught exception: _2fhome_2ffac2_2fhwxi_2fresearch_2fATS_2fIMPLEMENT_2fGeizella_2fAnairiats_2fsvn_2fats_2dlang_2fsrc_2flibats_lex_lexing_2esats__LexingErrorException(1235) | |
exit(ATS): [ccomp_file_to_file(uni_charsassign.dats, uni_charsassign_dats.c)] failed | |
*) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun string_length {n:nat} | |
(str: string n): size_t n = let | |
fun loop {i:nat | i <= n} | |
(str: string n, i: size_t i): size_t (n) = | |
if string_isnot_at_end (str, i) then loop (str, i+1) else i | |
in | |
loop (str, 0) | |
end | |
implement main () = begin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use Coro; | |
my $offset = 0; | |
my $inc = 100; | |
my $max = 6; | |
my @coros; | |
my $stdout = "Incrementing \$offset by $inc...\n---\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use subs::auto; | |
my %vars; | |
sub var (*) :lvalue { | |
my $var = shift; | |
no strict 'refs'; | |
no warnings 'redefine'; | |
*{$var} = sub { (\%vars)->{$var}; }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use autobox; | |
package A; | |
sub call { print "A!\n" } |
NewerOlder