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
(defclass (term A)) | |
(defclass literal-term ((term number)) | |
((value number)) | |
(:constructor ((value number)))) | |
(defclass is-zero-term ((term boolean)) | |
((subterm (term number))) | |
(:constructor ((subterm (term number))))) |
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
#include <stdio.h> | |
#define CALL(name, ...) \ | |
{ \ | |
int the_args[] = { __VA_ARGS__ }; \ | |
name(sizeof(the_args) / sizeof(int), the_args); \ | |
} | |
void the_fun(unsigned nargs, int *args) | |
{ |
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
// mutually recursive listener and broadcaster types with | |
// f-bounded polymorphism | |
class ListenerType<L extends ListenerType<L, B>, B extends BroadcasterType<L, B>> { | |
} | |
class BroadcasterType<L extends ListenerType<L, B>, B extends BroadcasterType<L, B>> { | |
} | |
class Listener extends ListenerType<Listener, Broadcaster> { | |
} | |
class Broadcaster extends BroadcasterType<Listener, Broadcaster> { | |
} |
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
print "You have no mail.\n" | |
10000.times { | |
'$ '.display | |
gets.each do | e | | |
if (e == "uname\n") | |
puts "Runix 1.0" | |
elsif (e == "halt\n") | |
exit | |
else |
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
// lambda trampoline. crashes with gcc -O2 and -O3. | |
#include <stddef.h> | |
#include <stdio.h> | |
void | |
foo(char *s) | |
{ | |
__asm("foo_label:"); | |
printf("%s\n", s); |
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
// lambda trampoline | |
#include <stdio.h> | |
void foo(char *s) | |
{ | |
__asm("foo_label:"); | |
printf("%s\n", s); | |
} | |
NewerOlder