Skip to main content

BlogChain

The place where the blog meets the chain

2 minutes read

Pact 2.3.8 is out!

The latest version of Kadena’s smart-contract language, Pact 2.3.8, is released! This update boasts auto-completion and full readline support for the pact command line interpreter, no more rlwrap required. Hit tab to see all completions, up-arrow and down-arrow for history, Ctrl-A for beginning of line, Ctrl-E for end, etc. All made possible in record time by the incomparable Joel Burget.

Also community member Konrad Scorciapino (“konr” on github) made heroic docs updates. Remember, in a LISP the docs follow the code, don’t forget you can get full docs on a function right from the interpreter and not scramble for the language reference! Here’s konr’s corrected docs for with-read-default:

pact
    pact> with-default-read    (TNative with-default-read (table:table:<{row}> key:string defaults:object:<{row}> bindings:binding:<{row}> -> <a>) Special form to read row from TABLE for KEY and bind columns per BINDINGS over subsequent body statements. If row not found, read columns from DEFAULTS, an object with matching key names. `$(with-default-read 'accounts id { "balance": 0, "ccy": "USD" } { "balance":= bal, "ccy":= ccy }       (format "Balance for {} is {} {}" [id bal ccy]))`)
pact
    pact> with-default-read    (TNative with-default-read (table:table:<{row}> key:string defaults:object:<{row}> bindings:binding:<{row}> -> <a>) Special form to read row from TABLE for KEY and bind columns per BINDINGS over subsequent body statements. If row not found, read columns from DEFAULTS, an object with matching key names. `$(with-default-read 'accounts id { "balance": 0, "ccy": "USD" } { "balance":= bal, "ccy":= ccy }       (format "Balance for {} is {} {}" [id bal ccy]))`)

brew upgrade kadena-io/pact/pact to get the goodness or head over to the download page.

Changelog

2.3.8

  • Pact tool improvements: auto-complete, readline support, better multiline
  • Fix documentation for format form
  • Internal changes: TableName in AST, expose evalRepl’, token parsing
  • build improvements: weeder, hlint enforcement