3

How do I comment out a chunk of code in Pact? Is there a shortcut in Atom for this?

I have tried command+? but it comments it out in HTML format.

This does however work in Pact Web (pact.kadena.io)

MegaTom
  • 312
  • 1
  • 6
  • 14
mleafer
  • 825
  • 2
  • 7
  • 15

1 Answers1

5

Pact is a Lisp-like language and so makes use of Lisp-style comments using semicolons (but not block comments). For example, if you wanted to comment out some pact code, you could do the following

(my-module 'my-keys
  ;(hello-world-old:string (name:string)
  ;  ...)

  (hello-world-new:string (name:string)
    ...)
)

You can make use of semicolons in really expressive ways, which are detailed in this great post here: Lisp commenting convention

Cheers, and happy hacking!

topos
  • 96
  • 3
  • 1
    So just for clarity - there is no block commenting in Pact in Atom currently. Is this shortcut enabled by the linter? https://atom.io/packages/language-pact or does this get built into the language? – mleafer Mar 06 '19 at 18:46
  • It's built into the language. You can use ';' for all your commenting needs. – topos Mar 06 '19 at 19:12
  • It's true that `language-pact` does not integrate with Cmd-K yet, a PR is welcome! https://github.com/kadena-io/pact-atom – spopejoy Mar 11 '19 at 20:33