11/*
22 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
33 *
4- * Copyright 2024 Neil C Smith.
4+ * Copyright 2025 Neil C Smith.
55 *
66 * This code is free software; you can redistribute it and/or modify it
77 * under the terms of the GNU Lesser General Public License version 3 only, as
@@ -45,6 +45,7 @@ class BaseCmds {
4545 private static final Set SET = new Set ();
4646 private static final Var VAR = new Var ();
4747 private static final Echo ECHO = new Echo ();
48+ private static final Print PRINT = new Print ();
4849
4950 private BaseCmds () {
5051 }
@@ -54,6 +55,7 @@ static void install(Map<String, Command> commands) {
5455 commands .put ("set" , SET );
5556 commands .put ("var" , VAR );
5657 commands .put ("echo" , ECHO );
58+ commands .put ("print" , PRINT );
5759 }
5860
5961 private static class Set implements InlineCommand {
@@ -119,4 +121,16 @@ public List<Value> process(Env context, Namespace namespace, List<Value> args) t
119121
120122 }
121123
124+ private static class Print implements InlineCommand {
125+
126+ @ Override
127+ public List <Value > process (Env context , Namespace namespace , List <Value > args ) throws Exception {
128+ if (args .size () != 1 ) {
129+ throw new Exception ();
130+ }
131+ return List .of (PString .of (args .get (0 ).print ()));
132+ }
133+
134+ }
135+
122136}
0 commit comments