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

* src/command.h (COMMAND_RETURN): Evaluate the return value even

if the continuation is NULL.

* src/command.c (discard_continuation): New continuation.

Rev: src/command.c:1.21
Rev: src/command.h:1.29
parent 9cad7403
......@@ -36,6 +36,16 @@
#include "command.c.x"
int do_discard_continuation(struct command_continuation *ignored UNUSED,
struct lsh_object *x UNUSED)
{
return LSH_OK | LSH_GOON;
}
struct command_continuation discard_continuation =
{ STATIC_HEADER, do_discard_continuation};
/* GABA:
(class
(name command_apply)
......@@ -55,6 +65,7 @@ struct command_continuation *
make_apply(struct command *f, struct command_continuation *c)
{
NEW(command_apply, res);
res->f = f;
res->super.up = c;
res->super.super.c = do_command_apply;
......
......@@ -72,8 +72,11 @@
#define COMMAND_CALL(f, a, c) \
((f)->call((f), (struct lsh_object *) (a), (c)))
/* NOTE: If R == NULL, don't call the continuation, _but_ the argument
* V must still be evaluated. */
#define COMMAND_RETURN(r, v) \
((r) ? ((r)->c((r), (struct lsh_object *) (v))) : LSH_OK | LSH_GOON)
((r) ? ((r)->c((r), (struct lsh_object *) (v))) : ((void)(v), LSH_OK | LSH_GOON))
#define COMMAND_SIMPLE(f, a) \
((f)->call_simple((f), (struct lsh_object *)(a)))
......@@ -89,6 +92,8 @@ int do_call_simple_command(struct command *s,
struct command *make_parallell_progn(struct object_list *body);
extern struct command_simple progn_command;
extern struct command_continuation discard_continuation;
/* GABA:
(class
(name command_frame)
......
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