mynt language

The language.

What Mynt can say beyond single SuiteScript calls: control flow, absence, searches, strings and bindings. Each area groups related syntax, and all of it is tracked apart from SuiteScript method coverage.

9 tracked language areas · 4 published on npm · 5 in the compiler only

Control flow

  1. Error handling npm 0.1.0 try, catch and finally, with the caught error typed as an Error whose message can be read. try { } catch err { } finally { }

Absence

  1. Optional values npm 0.1.0 A search that may find nothing gives an optional value: resolve it with or, or test it with if, and the compiler narrows it to present. ... or return if value { }

Searches

  1. Ordering and cardinality npm 0.1.0 order by, limit and first say how many rows a search returns and in which order, so the search fetches no more than that. order by field [desc] limit n first
  2. Summary searches npm 0.1.0 group by and named aggregates such as total = sum(amount) turn a search into a summary, with typed rows that carry exactly the groups and totals. group by field select name = sum(field)
  3. Summary criteria compiler only where can test aggregates as well as fields, such as sum(amount) > 10000, and Mynt filters rows before grouping and groups after it. where field === x && sum(field) > n

Strings

  1. Strings and interpolation compiler only Single quotes are the canonical string style, and ${expression} interpolates a string, number or boolean into either quote style. 'text' 'Hello ${name}'

Bindings

  1. Lookups and destructuring compiler only lookup names a field read explicitly, with select for the fields, and let { a, b: c } = binds the fields of a projection as locals. lookup Ref select a, b let { a, b: c } = ...

Records

  1. Operation modifiers compiler only One word changes how an operation behaves: dynamic holds a record in dynamic mode, soft save allows empty mandatory fields, save sourced sources dependent fields, and redirect edit opens a record for editing. load T(id) dynamic soft save r save r sourced redirect edit r

Platform objects

  1. load for platform types compiler only* load is one verb for retrieving anything by identity: the type after it decides whether it becomes a record, a saved search or a file. load Customer(id) load Search("id") load File(id)