diff --git a/src/core/asm.c b/src/core/asm.c index ec90b02c..da206d0d 100644 --- a/src/core/asm.c +++ b/src/core/asm.c @@ -294,7 +294,7 @@ static int32_t doarg_1( ret = dst_unwrap_integer(result); } } else { - dst_asm_errorv(a, dst_formatc("unknown name %q", x)); + dst_asm_errorv(a, dst_formatc("unknown name %v", x)); } } else if (argtype == DST_OAT_TYPE || argtype == DST_OAT_SIMPLETYPE) { const TypeAlias *alias = dst_strbinsearch( @@ -305,7 +305,7 @@ static int32_t doarg_1( if (alias) { ret = alias->mask; } else { - dst_asm_errorv(a, dst_formatc("unknown type %q", x)); + dst_asm_errorv(a, dst_formatc("unknown type %v", x)); } } else { goto error; @@ -314,7 +314,7 @@ static int32_t doarg_1( /* Add a new env */ ret = dst_asm_addenv(a, x); if (ret < -1) { - dst_asm_errorv(a, dst_formatc("unknown environment %q", x)); + dst_asm_errorv(a, dst_formatc("unknown environment %v", x)); } } break; diff --git a/src/core/core.dst b/src/core/core.dst index 350a6e66..dbd81e56 100644 --- a/src/core/core.dst +++ b/src/core/core.dst @@ -48,6 +48,12 @@ [name & more] (apply1 tuple (array.concat @['def name :private] more))) +(defmacro defasm + "Define a function using assembly" + [name & body] + (def tab (apply1 table body)) + (tuple 'def name (tuple asm (tuple 'quote tab)))) + # Basic predicates (defn even? [x] (== 0 (% x 2))) (defn odd? [x] (not= 0 (% x 2)))