Commit 29daf5eb authored by Niels Möller's avatar Niels Möller
Browse files

* src/combinators.c (command_Cp): Bugfix, changed argument order.

Rev: src/combinators.c:1.15
Rev: src/command.h:1.56
parent 2e023778
......@@ -233,13 +233,26 @@ DEFINE_COMMAND3(command_C)
e);
}
#if 0
/* FIXME: Move this function somewhere else. It should also be used by
* do_trace_continuation. */
static const char *
describe_object(struct lsh_object *x)
{
if (!x)
return "<NULL>";
if (!x->isa)
return "<STATIC>";
return x->isa->name;
}
#if 1
/* C' k f y x == k (f x) y */
DEFINE_COMMAND4(command_Cp)
(struct lsh_object *k,
struct lsh_object *f,
struct lsh_object *x,
struct lsh_object *y,
struct lsh_object *x,
struct command_continuation *c,
struct exception_handler *e)
{
......@@ -247,13 +260,18 @@ DEFINE_COMMAND4(command_Cp)
CAST_SUBTYPE(command, cf, f);
trace("command_Cp\n");
werror("command_Cp: k: %z, f: %z, y: %z, x: %z\n",
describe_object(k),
describe_object(f),
describe_object(y),
describe_object(x));
COMMAND_CALL(cf, x,
make_apply(ck,
make_command_C_continuation(y, c, e), e),
e);
}
#endif
#else
/* C' c f y x == c (f x) y */
......@@ -275,6 +293,12 @@ do_command_Cp_3(struct command *s,
struct exception_handler *e)
{
CAST(command_Cp_3, self, s);
werror("do_command_Cp_3: k: %z, f: %z, y: %z, x: %z\n",
describe_object(&self->c->super),
describe_object(&self->f->super),
describe_object(self->y),
describe_object(x));
COMMAND_CALL(self->f, x,
make_apply(self->c,
......@@ -329,3 +353,4 @@ STATIC_COLLECT_2(&collect_info_Cp_3);
struct collect_info_1 command_Cp =
STATIC_COLLECT_1(&collect_info_Cp_2);
#endif
......@@ -475,7 +475,7 @@ extern struct command_3 command_C;
#define GABA_APPLY_C_2(f, g) \
((struct lsh_object *) make_command_3_invoke_2(&command_C, (f), (g)))
#if 0
#if 1
extern struct command_4 command_Cp;
#define GABA_VALUE_Cp (&command_Cp.super.super)
......@@ -485,7 +485,7 @@ extern struct command_4 command_Cp;
((struct lsh_object *) make_command_4_invoke_2(&command_Cp, (c), (f)))
#define GABA_APPLY_Cp_3(c, f, g) \
((struct lsh_object *) make_command_4_invoke_3(&command_Cp, (c), (f), (g)))
#endif
#else
extern struct collect_info_1 command_Cp;
extern struct collect_info_2 collect_info_Cp_2;
......@@ -507,4 +507,6 @@ collect_Cp_3(struct collect_info_3 *info,
(make_collect_state_2(&collect_info_Cp_2, (c), (f)))
#define GABA_APPLY_Cp_3(c, f, y) (collect_Cp_3(&collect_info_Cp_3, (c), (f), (y)))
#endif
#endif /* LSH_COMMAND_H_INCLUDED */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment