Minor syntax changes

Howdy

Just wanted to let you know that I’ll be changing a few operators:

  • ' … pair
    • e.g. [ pair "a" 1, pair "b" 2 ] becomes [ "a"'1, "b"'2 ]
  • ~ … record access
    • e.g. rec ~ a
    • e.g. { a = 1 } ~ a
    • e.g. customer~address~city
    • e.g. my-rec ~ x
    • e.g. my-rec~x
  • ; … byte
    • ;ff
    • ;0A
  • ;; … bytes
    • e.g. ;;aG93ZHk=
    • e.g. $md5;;0782efd61b7a6b02e602cc6a11673ec9

Let me know if you have any thoughts/feedback!

Thanks for your patient support

1 Like

My take is obviously subjective, but, with regards to using ' for pairs, I feel like it may cause scrapscript code to be harder to read than it needs to be. Seeing " and ' juxtaposed makes my brain do a double take in order to reconcile what’s going on. I find that invoking pair as a function is clearer and more unambiguous.

I like the idea of using ~ for record access. It feels similar enough to the traditional record dot notation as to not be too overwhelming.

I think I’m somewhat neutral on the use of ; and ;; for singular bytes and multiple bytes respectively.

1 Like