Results 1 to 4 of 4

Thread: Template strings in ash!

  1. #1

    Default Template strings in ash!

    I've been recovering from what was hopefully not coronavirus and wanting to do some programming without actually returning to my day job just yet, so here I am.

    Like python's f strings and JavaScript's template strings, I wrote some changes to to achieve the same thing for ASH. If you use backticks (`) to define a string, you can then use curly braces to concatenate expressions in a fashion that's a little more fluent and terse.

    For example:

    print(`Hello, {my_name()}! How are you doing today?`);
    I've tested it extensively, including various combinations of escaped tokens but still posting a patch here before I commit it to gauge if it's a desired feature as much as to sense check the code itself
    Attached Files

  2. #2
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    The Unseelie Court


    With the exception of the System.out.println() debugging calls, this looks pretty neat.
    And useful. It obviates all sorts of explicit string concatenation with "+".
    Last edited by Veracity; 03-23-2020 at 05:34 PM.

  3. #3


    With the exception of the System.out.println() debugging calls
    Originally Posted by Veracity View Post

    But thanks Veracity. I'll go ahead and merge it once I've sorted that.

  4. #4



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts