unofficial mirror of gwl-devel@gnu.org
 help / color / mirror / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: zimoun <zimon.toutoune@gmail.com>
Cc: gwl-devel@gnu.org
Subject: Re: objections to short syntax for code snippets?
Date: Wed, 05 Feb 2020 16:10:36 +0100	[thread overview]
Message-ID: <87eev9qdcj.fsf@elephly.net> (raw)
In-Reply-To: <CAJ3okZ01=3w7Jj_1_A_T2DAy3fgzuVpXBDYK4hdySwbZcCbp=A@mail.gmail.com>


zimoun <zimon.toutoune@gmail.com> 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	other threads:[~2020-02-05 15:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-04 13:05 objections to short syntax for code snippets? Ricardo Wurmus
2020-02-04 13:31 ` Roel Janssen
2020-02-05 14:40 ` zimoun
2020-02-05 15:10   ` Ricardo Wurmus [this message]
2020-02-05 15:21     ` Pjotr Prins
2020-02-05 15:31     ` zimoun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.guixwl.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eev9qdcj.fsf@elephly.net \
    --to=rekado@elephly.net \
    --cc=gwl-devel@gnu.org \
    --cc=zimon.toutoune@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).