Ilya Zakharevich on Sun, 10 Dec 2023 05:10:01 +0100


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

Re: The GP command “?”


On Sat, Dec 09, 2023 at 07:49:50PM -0800, Ilya Zakharevich wrote:
>   flavors such as +=) and other operators (inspect the output of ?19
>   or ?_\_ or ?_! or ?_===_  etc. for details).  The command separator
>   is “;”.

Probably one should better add:

  A trailing “;” suppresses echoing the last result.

>   Thousands of available functions are split into “topics” (inspect
>   them via the list emitted by the command ?sections).  User-defined
>   functions (listed by ?0) are stored in variables (like f below) and
>   are defined as:
>     f(mandatory_arg, optional_arg=default) = N++; mandatory_arg+optional_arg
>   or equivalently (omit parentheses if this terminates a command):
>     (f = (mandatory_arg, optional_arg=default) -> N++; mandatory_arg+optional_arg)

Probably one should better add:

  A function returns the result of its last subcommand.  (In
  particular, to make it void, terminate with “; if(0)”.)

Yours,
Ilya