Websites Navigation: Airbit | Shop | m-shell.net
Languages: EN | DE

Simplified Syntax for Interactive Use

Since input capabilities of cellphones are poor, interactive shells support a simplified syntax for function calls, and automatic output of computed expressions:

  • A single Expression will be executed as 'print' Expression, unless it is null:

    m>0.85*23.10
    → 19.635
    m>use math as m
    m>m.sin(m.pi/4)
    → 0.7071067812

  • A SimpleFunctionCall calls a function with only string or number literal parameters, and options defined for the function.
    • Unquoted words (sequences not containing white space) on the command line which are not keywords (see appendix * ()) and are not starting with a digit or separator are interpreted as string parameters.
    • Numbers are interpreted as numeric parameters.
    • Options for optional parameters (see section * ()) can be specified anywhere with a preceding slash. If an equal sign follows, the following word or number is assigned to the corresponding parameter. If no equal sign follows, true is assigned to the corresponding parameter.
    • Commas to separate the parameters are not permitted.
    Again, the function result is printed if it is not null:

    m>date  // maps to date()
    → 2005-02-07 11:03:07
    m>dir c:\*.m/r  // maps to dir('c:\\*.m', true)
    → C:\system\apps\mShell\autoexec.m
    C:\documents\mShell\Jukebox.m

    Simple function calls can only be used to call functions with parameters which are string or number literals.

SimpleFunctionCall :=
  [ModulePrefix] Identifier {SimpleParam | SimpleOption} .
SimpleParam :=
  SimpleChar {SimpleChar} | StringLiteral | NumberLiteral .
SimpleOption := '/' (IdentifierChar | Digit) ['=' SimpleParam] .
SimpleChar :=
  (printable ISO-8859-1 char except white space and '/') .


© 2004-2011 airbit AG, CH-8008 Zürich
Document AB-M-REF-887
mShell Home  > Documentation  > Manuals