From 900c223ed40e36ffedce95e9a987d9a3c0309271 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Wed, 12 Apr 2017 16:47:45 +0200 Subject: Implementent conditional primitive --- repl.d | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'repl.d') diff --git a/repl.d b/repl.d index 89c3104..4938a11 100644 --- a/repl.d +++ b/repl.d @@ -12,7 +12,14 @@ static import src.definition; static import src.primitives; void process(int x) { - stack.push(x); + try { + if ( !src.primitives.evaluate(x) ) { + stack.push(x); + } + } + catch (Exception ex) { + writeln("Error: ", ex.msg); + } } void process(string word) { -- cgit v1.2.3