write function should be print even env objects

This commit is contained in:
Yuichi Nishiwaki 2013-10-29 16:44:38 +09:00
parent a0a8a94abc
commit 073f45666a
2 changed files with 5 additions and 1 deletions

View File

@ -23,6 +23,9 @@ struct pic_port {
};
#define pic_port_p(v) (pic_type(v) == PIC_TT_PORT)
#define pic_env_p(v) (pic_type(v) == PIC_TT_ENV)
#define pic_port_ptr(v) ((struct pic_port *)(v).u.data)
#define pic_env_ptr(v) ((struct pic_env *)(v).u.data)
#endif

View File

@ -65,7 +65,8 @@ write(pic_state *pic, pic_value obj)
printf(")");
break;
case PIC_TT_ENV:
pic_abort(pic, "logic flaw");
printf("#<env %p>", pic_env_ptr(obj));
break;
}
}