From: Ricardo Wurmus <rekado@elephly.net>
To: Roel Janssen <roel@gnu.org>
Cc: gwl-devel@gnu.org
Subject: Re: Comments on process template syntax
Date: Mon, 03 Feb 2020 15:33:24 +0100 [thread overview]
Message-ID: <87k153spu3.fsf@elephly.net> (raw)
In-Reply-To: <6be1d411b6caab4e91b67fd24bde5095afb65bc5.camel@gnu.org>
Roel Janssen <roel@gnu.org> writes:
> May I suggest one other thing? Maybe I don't grasp Wisp at all, but
> why not:
>
> process: list-file-template (filename)
> name …
> inputs …
> outputs …
>
> process: list-some-file.txt
> inputs some-file.txt
> outputs …
I don’t see how this differs from what I suggested… other than the
renaming of “process:” to “process”.
Let’s ignore the name of that macro and go with “process:”. Currently,
you’d write it as
process: (list-file-template filename)
name …
inputs …
outputs …
or for the concrete case:
process: list-some-file.txt
inputs "some-file.txt"
outputs …
There’s little here that’s Wisp specific. It translates to this Scheme
code:
(process: (list-file-template filename)
(name …)
(inputs …)
(outputs …))
and
(process: list-some-file.txt
(inputs "some-file.txt")
(outputs …))
The macro “process:” just expands these things to
(define-public (list-file-template filename)
(process
(name …)
(inputs …)
(outputs …)))
and
(define-public list-some-file.txt
(process
(name "list-some-file.txt")
(inputs "some-file.txt")
(outputs …)))
[[
Now, “process” is actually a macro that performs a few more convenient
transformations, such as wrapping inputs in a list and all that, and it
then creates an instance of the GOOPS class <process> by doing
(make <process> …)
where “…” stands for sanitized arguments. Not important for this
discussion, though.
]]
I’m proposing two things:
1) get rid of the “:” in the macro name because it could be confused for
syntax — both for the Wisp “:” that means “wrap this in parens” and for
SRFI-88 style keywords. Rename the lower level “process” and “workflow”
macros — those that are wrappers around “(make <process> …)” and “(make
<workflow> …)” — to “make-process” and “make-workflow”, respectively, to
avoid naming conflicts.
2) move the procedure name outside of the parentheses when using the
“process” (formerly “process:”) macro.
This means that the examples above would be written as
process list-file-template (filename)
name …
inputs …
outputs …
and
process list-some-file.txt
inputs "some-file.txt"
outputs …
It’s a pretty small change, but I think it reduces the potential for
confusion and removes unnecessary characters (the colon).
--
Ricardo
next prev parent reply other threads:[~2020-02-03 14:33 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-02 10:20 Comments on process template syntax Ricardo Wurmus
2020-02-02 23:30 ` Kyle Meyer
2020-02-03 8:08 ` Ricardo Wurmus
2020-02-03 14:22 ` Kyle Meyer
2020-02-03 15:23 ` Ricardo Wurmus
2020-02-03 23:16 ` Kyle Meyer
2020-02-04 9:55 ` Ricardo Wurmus
2020-02-05 1:48 ` Kyle Meyer
2020-02-05 15:14 ` zimoun
2020-02-03 8:58 ` Roel Janssen
2020-02-03 12:07 ` Ricardo Wurmus
2020-02-03 12:56 ` Roel Janssen
2020-02-03 14:33 ` Ricardo Wurmus [this message]
2020-02-04 10:10 ` Ricardo Wurmus
2020-02-05 2:12 ` Kyle Meyer
2020-02-05 15:21 ` zimoun
2020-02-05 15:29 ` Kyle Meyer
2020-02-05 15:37 ` zimoun
2020-02-05 16:02 ` Kyle Meyer
2020-02-05 16:23 ` zimoun
2020-02-05 15:07 ` zimoun
2020-02-05 18:04 ` Ricardo Wurmus
2020-02-05 19:14 ` zimoun
2020-02-05 21:32 ` Ricardo Wurmus
2020-02-06 11:59 ` zimoun
2020-02-05 14:56 ` zimoun
2020-02-08 12:34 ` Ricardo Wurmus
2020-02-05 14:50 ` 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=87k153spu3.fsf@elephly.net \
--to=rekado@elephly.net \
--cc=gwl-devel@gnu.org \
--cc=roel@gnu.org \
/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).