From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:39309) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iycnC-0005ie-PC for gwl-devel@gnu.org; Mon, 03 Feb 2020 09:33:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iycnB-0006B0-KQ for gwl-devel@gnu.org; Mon, 03 Feb 2020 09:33:38 -0500 References: <871rrdthmz.fsf@elephly.net> <87lfpjswla.fsf@elephly.net> <6be1d411b6caab4e91b67fd24bde5095afb65bc5.camel@gnu.org> From: Ricardo Wurmus Subject: Re: Comments on process template syntax In-reply-to: <6be1d411b6caab4e91b67fd24bde5095afb65bc5.camel@gnu.org> Date: Mon, 03 Feb 2020 15:33:24 +0100 Message-ID: <87k153spu3.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gwl-devel-bounces+kyle=kyleam.com@gnu.org Sender: "gwl-devel" To: Roel Janssen Cc: gwl-devel@gnu.org Roel Janssen writes: > May I suggest one other thing? Maybe I don't grasp Wisp at all, but > why not: > > process: list-file-template (filename) > name =E2=80=A6 > inputs =E2=80=A6 > outputs =E2=80=A6 > > process: list-some-file.txt > inputs some-file.txt > outputs =E2=80=A6 I don=E2=80=99t see how this differs from what I suggested=E2=80=A6 other t= han the renaming of =E2=80=9Cprocess:=E2=80=9D to =E2=80=9Cprocess=E2=80=9D. Let=E2=80=99s ignore the name of that macro and go with =E2=80=9Cprocess:= =E2=80=9D. Currently, you=E2=80=99d write it as process: (list-file-template filename) name =E2=80=A6 inputs =E2=80=A6 outputs =E2=80=A6 or for the concrete case: process: list-some-file.txt inputs "some-file.txt" outputs =E2=80=A6 There=E2=80=99s little here that=E2=80=99s Wisp specific. It translates to= this Scheme code: (process: (list-file-template filename) (name =E2=80=A6) (inputs =E2=80=A6) (outputs =E2=80=A6)) and (process: list-some-file.txt (inputs "some-file.txt") (outputs =E2=80=A6)) The macro =E2=80=9Cprocess:=E2=80=9D just expands these things to (define-public (list-file-template filename) (process (name =E2=80=A6) (inputs =E2=80=A6) (outputs =E2=80=A6))) and (define-public list-some-file.txt (process (name "list-some-file.txt") (inputs "some-file.txt") (outputs =E2=80=A6))) [[ Now, =E2=80=9Cprocess=E2=80=9D 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 by doing (make =E2=80=A6) where =E2=80=9C=E2=80=A6=E2=80=9D stands for sanitized arguments. Not impo= rtant for this discussion, though. ]] I=E2=80=99m proposing two things: 1) get rid of the =E2=80=9C:=E2=80=9D in the macro name because it could be= confused for syntax =E2=80=94 both for the Wisp =E2=80=9C:=E2=80=9D that means =E2=80=9C= wrap this in parens=E2=80=9D and for SRFI-88 style keywords. Rename the lower level =E2=80=9Cprocess=E2=80=9D a= nd =E2=80=9Cworkflow=E2=80=9D macros =E2=80=94 those that are wrappers around =E2=80=9C(make = =E2=80=A6)=E2=80=9D and =E2=80=9C(make =E2=80=A6)=E2=80=9D =E2=80=94 to =E2=80=9Cmake-process=E2=80=9D = and =E2=80=9Cmake-workflow=E2=80=9D, respectively, to avoid naming conflicts. 2) move the procedure name outside of the parentheses when using the =E2=80=9Cprocess=E2=80=9D (formerly =E2=80=9Cprocess:=E2=80=9D) macro. This means that the examples above would be written as process list-file-template (filename) name =E2=80=A6 inputs =E2=80=A6 outputs =E2=80=A6 and process list-some-file.txt inputs "some-file.txt" outputs =E2=80=A6 It=E2=80=99s a pretty small change, but I think it reduces the potential for confusion and removes unnecessary characters (the colon). -- Ricardo