rename functions related to continuation

This commit is contained in:
Yuichi Nishiwaki
2015-06-02 06:18:09 +09:00
parent 02f0d00578
commit 5df4e4f64e
4 changed files with 37 additions and 37 deletions
+5 -5
View File
@@ -9,7 +9,7 @@
extern "C" {
#endif
struct pic_escape {
struct pic_cont {
pic_jmpbuf jmp;
struct pic_winder *wind;
@@ -24,10 +24,10 @@ struct pic_escape {
pic_value results;
};
void pic_save_point(pic_state *, struct pic_escape *);
void pic_load_point(pic_state *, struct pic_escape *);
void pic_save_point(pic_state *, struct pic_cont *);
void pic_load_point(pic_state *, struct pic_cont *);
struct pic_proc *pic_make_econt(pic_state *, struct pic_escape *);
struct pic_proc *pic_make_cont(pic_state *, struct pic_cont *);
void pic_wind(pic_state *, struct pic_winder *, struct pic_winder *);
pic_value pic_dynamic_wind(pic_state *, struct pic_proc *, struct pic_proc *, struct pic_proc *);
@@ -42,7 +42,7 @@ pic_value pic_values_by_array(pic_state *, size_t, pic_value *);
pic_value pic_values_by_list(pic_state *, pic_value);
size_t pic_receive(pic_state *, size_t, pic_value *);
pic_value pic_escape(pic_state *, struct pic_proc *);
pic_value pic_callcc(pic_state *, struct pic_proc *);
#if defined(__cplusplus)
}
+5 -5
View File
@@ -28,13 +28,13 @@ struct pic_error *pic_make_error(pic_state *, pic_sym *, const char *, pic_list)
pic_try_(PIC_GENSYM(escape))
#define pic_catch \
pic_catch_(PIC_GENSYM(label))
#define pic_try_(escape) \
#define pic_try_(cont) \
do { \
struct pic_escape *escape = pic_malloc(pic, sizeof(struct pic_escape)); \
pic_save_point(pic, escape); \
if (PIC_SETJMP(pic, (void *)escape->jmp.buf) == 0) { \
struct pic_cont *cont = pic_malloc(pic, sizeof(struct pic_cont)); \
pic_save_point(pic, cont); \
if (PIC_SETJMP(pic, cont->jmp.buf) == 0) { \
do { \
pic_push_try(pic, pic_make_econt(pic, escape));
pic_push_try(pic, pic_make_cont(pic, cont));
#define pic_catch_(label) \
pic_pop_try(pic); \
} while (0); \