This file contains hidden or 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
/* | |
My very own setjmp. | |
*/ | |
#include <stdio.h> | |
#include <stdbool.h> | |
#include <stdlib.h> | |
typedef struct Continuation { | |
void* rip; |
This file contains hidden or 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> | |
#include <stdbool.h> | |
#include <stdlib.h> | |
#include <stdarg.h> | |
typedef unsigned char byte; | |
typedef struct Continuation { | |
void* rip; | |
void* rsp; |
This file contains hidden or 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> | |
#include <stdbool.h> | |
#include <stdlib.h> | |
#include <stdarg.h> | |
#define NOINLINE __attribute__((noinline)) | |
typedef unsigned char byte; | |
typedef struct Continuation { |
This file contains hidden or 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> | |
#include <stdbool.h> | |
#include <stdlib.h> | |
#include <stdarg.h> | |
#include <string.h> | |
#define NOINLINE __attribute__((noinline)) | |
const size_t CONTINUATION_STACK_SIZE = 8192; |
This file contains hidden or 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
/* | |
cc === "current continuation" | |
*/ | |
bar: { | |
foo() | |
} | |
foo: { |
This file contains hidden or 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
foo: [a, b, *rest] { | |
bar: [*args] { | |
baz(*rest, *args) | |
local a, b: *args | |
} | |
} |
This file contains hidden or 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
a: 123 | |
foo: { | |
a: 456 | |
} | |
foo() | |
puts(a) // 123 eller 456? |
This file contains hidden or 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
obj.set_instance_var(:@foo, 123) | |
@foo = 456 | |
obj.instance_eval { | |
puts @foo #=> 123 | |
} |
This file contains hidden or 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
static int n = 0; | |
class A { | |
public: | |
virtual void foo() { | |
++n; | |
} | |
}; | |
class B : public A { |
This file contains hidden or 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
static int n = 0; | |
int make(int t) { return t; } | |
void foo_a() { ++n; } | |
void foo_b() { ++n; } | |
void foo_c() { ++n; } | |
void foo_d() { ++n; } | |
int foo(int t) |