From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:40334) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iyvAN-0002xC-Ae for gwl-devel@gnu.org; Tue, 04 Feb 2020 05:10:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iyvAL-0001Bi-Is for gwl-devel@gnu.org; Tue, 04 Feb 2020 05:10:47 -0500 References: <871rrdthmz.fsf@elephly.net> <87lfpjswla.fsf@elephly.net> <6be1d411b6caab4e91b67fd24bde5095afb65bc5.camel@gnu.org> <87k153spu3.fsf@elephly.net> From: Ricardo Wurmus Subject: Re: Comments on process template syntax In-reply-to: <87k153spu3.fsf@elephly.net> Date: Tue, 04 Feb 2020 11:10:33 +0100 Message-ID: <874kw6slwm.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 Ricardo Wurmus writes: > 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 [=E2=80=A6] I just realized that this is not easily accomplished without warts. The reason is that we have no way of distinguishing this (process list-file-template (filename) (name =E2=80=A6) (inputs =E2=80=A6) (outputs =E2=80=A6)) from that (process list-file-template (filename) (name =E2=80=A6) (inputs =E2=80=A6) (outputs =E2=80=A6)) or worse (process list-file-template (name foo bar) (name =E2=80=A6) (inputs =E2=80=A6) (outputs =E2=80=A6)) Is this a process definition with two =E2=80=9Cname=E2=80=9D fields? Or what about this: (process list-file-template (name some-variable-name) (inputs =E2=80=A6) (outputs =E2=80=A6)) Is this a process template with two arguments =E2=80=9Cname=E2=80=9D and =E2=80=9Csome-variable-name=E2=80=9D, or is this a process with a name fiel= d whose value is whatever =E2=80=9Csome-variable-name=E2=80=9D evaluates to? The power o= f macros only gets us that far. Sure we could add even more heuristics and check whether things in the first position are identifiers and such, but this sounds terribly complex. This can all be avoided with a tad more syntax, but it=E2=80=99s slightly l= ess elegant: process list-file-template (with filename) name =E2=80=A6 inputs =E2=80=A6 outputs =E2=80=A6 This is obviously a template because it uses =E2=80=9Cwith=E2=80=9D followe= d by a list of arguments. Other ways of writing this in Wisp: process list-file-template with filename name =E2=80=A6 inputs =E2=80=A6 outputs =E2=80=A6 or process list-file-template : with filename name =E2=80=A6 inputs =E2=80=A6 outputs =E2=80=A6 Without (gwl sugar process) you can, of course, still write good ol=E2=80=99 procedures explicitly if you prefer, so all of this is optional: (define list-file-template (lambda (filename) (process (name =E2=80=A6) (inputs =E2=80=A6) (outputs =E2=80=A6)))) Thoughts? -- Ricardo