From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gkmQZ-0003DB-6U for mharc-gwl-devel@gnu.org; Sat, 19 Jan 2019 03:56:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42097) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkmQX-0003D1-6T for gwl-devel@gnu.org; Sat, 19 Jan 2019 03:56:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gkmQW-0008Lc-9T for gwl-devel@gnu.org; Sat, 19 Jan 2019 03:56:29 -0500 Received: from sender-of-o53.zoho.com ([135.84.80.218]:21739) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gkmQU-00081z-K9 for gwl-devel@gnu.org; Sat, 19 Jan 2019 03:56:28 -0500 From: Ricardo Wurmus Date: Sat, 19 Jan 2019 09:55:58 +0100 Message-ID: <87bm4df2ld.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: =?UTF-8?B?bWVyZ2luZyDigJxwcm9jZXNzZXPigJ0gYW5kIOKAnHJlc3RyaWN0?= =?UTF-8?B?aW9uc+KAnQ==?= List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: gwl-devel@gnu.org Hi, I think it is unfortunate that workflows have two fields for specifying processes: one is =E2=80=9Cprocesses=E2=80=9D the other is =E2=80=9Crestric= tions=E2=80=9D. It seems to me that we can do without =E2=80=9Crestrictions=E2=80=9D by relaxing the re= quirements for the =E2=80=9Cprocesses=E2=80=9D value. The use of both fields sometimes makes it necessary to wrap the whole workflow definition in a let binding so that both fields can access identical values: (let ((eat-fruit (eat "fruit")) (eat-veges (eat "vegetables"))) (workflow (name "simple") (processes (list greet eat-fruit eat-veges sleep bye)) (restrictions `((,eat-fruit ,greet) (,eat-veges ,greet) (,sleep ,eat-fruit ,eat-veges) (,bye ,sleep))))) This looks like a minor improvement to me because the let can be where it=E2=80=99s needed: (workflow (name "simple") (processes (let ((eat-fruit (eat "fruit")) (eat-veges (eat "veges"))) (list (list eat-fruit greet) (list eat-veges greet) (list sleep eat-fruit eat-veges) (list bye sleep))))) All of the elements of the list together is equivalent to the list of processes. The =E2=80=9Cprocesses=E2=80=9D field now also doubles as a =E2= =80=9Crestrictions=E2=80=9D field as the value can be an adjacency list of processes to their dependencies. For trivial processes where none of the processes depend on each other it would look like this: (workflow (name "simple") (processes (list (list A) (list B) (list C)))) With just a little bit of extra processing before storing the value it could become this instead: (workflow (name "simple") (processes A B C)) If you=E2=80=99re like me you=E2=80=99ll find that the restrictions syntax = looks rather verbose with all those =E2=80=9Clist=E2=80=9Ds. Using quoting doesn=E2=80= =99t make this any more readable, unfortunately: (workflow (name "simple") (processes (let ((eat-fruit (eat "fruit")) (eat-veges (eat "veges"))) `((,eat-fruit ,greet) (,eat-veges ,greet) (,sleep ,eat-fruit ,eat-veges) (,bye ,sleep))))) Can we use macros to clarify the syntax? (workflow (name "simple") (processes (let ((eat-fruit (eat "fruit")) (eat-veges (eat "veges"))) (graph (eat-fruit -> greet) (eat-veges -> greet) (sleep -> eat-fruit eat-veges) (bye -> sleep))))) =E2=80=9Cgraph=E2=80=9D would be a macro that takes any number of node to n= ode associations, each of which are expected to be in the form (node -> nodes =E2=80=A6) =E2=80=9Cgraph=E2=80=9D isn=E2=80=99t a great name. Maybe you can suggest = a different name or even a character=E2=80=A6 What do you think? -- Ricardo