[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trivial feature request

From: Chris Moller
Subject: Re: Trivial feature request
Date: Sun, 5 Jan 2020 10:09:49 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0

Would it be worthwhile having --eval imply --noColor?  The most common use of --eval, I suspect, will just want the numerical result.


On 03/01/2020 14:21, Dr. Jürgen Sauermann wrote:
Hi Chris,

I decided to implement the requested feature differently. In order to
reduce the number of command line options needed to achieve
the desired effect, I have added a new command line option --eval
which can be used like this:

apl --eval "((4 5 6)+(7 8 9))÷2"
5.5 6.5 7.5

Keep in mind that the shell processes the line before apl
gets it, so the quotes above are removed etc. To get the
quotes into apl they need to be escaped according to the
shell's rules.

SVN 1215.

Best regards,

On 1/2/20 3:33 AM, Chris Moller wrote:
Hi, Jürgen,

A really minor request:

Index: src/main.cc
--- src/main.cc (revision 1210)
+++ src/main.cc (working copy)
@@ -425,6 +425,7 @@
            CERR << "executing --LX '" << lx << "'" << endl;
+       if (uprefs.auto_OFF) Command::cmd_OFF(0);
    // maybe )LOAD the CONTINUE or SETUP workspace. Do that unless the user

What this does, obviously, is allow command-line one-liners like, for example:
apl --OFF -s --LX "((4 5 6)+(7 8 9))÷2"
Without the patch, apl just goes into accepting-input mode; with it, apl can be used, for example, to evaluate expressions in scripts:
VAL=`apl --OFF -s --LX "((4 5 6)+(7 8 9))÷2"`
Chris Moller

reply via email to

[Prev in Thread] Current Thread [Next in Thread]