gwl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: objections to short syntax for code snippets?


From: Ricardo Wurmus
Subject: Re: objections to short syntax for code snippets?
Date: Wed, 05 Feb 2020 16:10:36 +0100
User-agent: mu4e 1.2.0; emacs 26.3

zimoun <address@hidden> writes:

>> --8<---------------cut here---------------start------------->8---
>> process run-sh
>>   inputs
>>     . "a"
>>     . mine: "b"
>>     . "c"
>>     . yours: "d"
>>   # {
>>     echo "This is mine: {{inputs:mine}}, and this is yours: 
>> {{inputs:yours}}."
>>   }
>> --8<---------------cut here---------------end--------------->8---
>
>
> This is cool!
>
> Aside your question, I am thinking if WISP could be adapted to use
> dash '-' instead of dot '.' in the field 'inputs'.

Tricky!  The “.” in Wisp just means “continue the previous line”.  In
this example it just looks really similar to a dash that’s used in YAML
to mark individual list items.

We don’t need any of these dots.  We could also just write this all on
one line (or any number of broken lines):

    process run-sh
      inputs "a"
        . mine: "b" "c" yours:
        . "d"
      # {
        echo "This is mine: {{inputs:mine}}, and this is yours: 
{{inputs:yours}}."
      }

This is equivalent, no difference whatsoever.

So my use of the dot is very suggestive, but there’s no way we can turn
it into a dash.

That said … macrology can be used to assign the dash special meaning (or
no meaning at all), but I’m not convinced that this would be a good
idea.  Lists are easier in Lisp compared to YAML — and thanks to what I
call “implicit lists” for the “inputs” and “outputs” fields you don’t
even need to start them with “list”.  It seems futile to try to make
lists more complicated by requiring that items begin with a dash.

--
Ricardo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]