Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Carlos Newsgroups: comp.lang.postscript Subject: Re: Type-checked function arguments - Re: Binding - Re: Control Structures (Ordered Dictionaries) Date: Wed, 26 Jul 2017 16:41:32 +0200 Organization: A noiseless patient Spider Lines: 27 Message-ID: <20170726164132.25b1eb9a@samara.DOMA> References: <2f65c3d3-60f0-48d6-af25-7af2964b9254@googlegroups.com> <20170623002801.61560cd4@samara.DOMA> <3c26cbff-0802-482a-a6d2-07b17781a1d4@googlegroups.com> <73236ae3-bc2c-4fea-b4a5-bf43bf4d9060@googlegroups.com> <8daef6c8-92d4-4de1-b2db-5c71d8f68cfb@googlegroups.com> <0de6e3e8-33c0-4d6a-9c32-44a880509c84@googlegroups.com> <20170704172151.27a32f78@samara.DOMA> <9c61ec9b-2d69-4216-a18b-36c661c81dd4@googlegroups.com> <34e28872-ee7e-430e-a016-00146b8e7739@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Info: mx02.eternal-september.org; posting-host="1587e03f6a6006b420d53714e1d45dd8"; logging-data="18035"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/yRnrPt/jEMWOanasZ8XcCCErM+wGSSjE=" X-Newsreader: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Cancel-Lock: sha1:kaMbii7mUI+/9lxbWmS7/0S8Kso= Xref: csiph.com comp.lang.postscript:3144 [luser droog , 2017-07-25 23:07] [...] > Of course anyone with opinions, feel free to jump in. I have, for now, having superficially perused the post, one superficial opinion: I hate the redefinition of ">>". I'd reuse {}, making executable names parameter names and literal names type names. That'd also allow having typed and untyped parameters in the same function. Of course it'd also make parameter parsing more complex. Some examples to get a feel... /arrayput { arr/arraytype idx/integertype item } { ... } func def /fortuple { arr size/integertype proc/arraytype } { ... } func-begin def [...] > It may be desirable to add some addition "pattern" pseudo-typenames > so you can check some of the arguments and use /any or /anytype to > ignore the types of other arguments. Or that's another possibility for untyped parameters, of course. I have some unfinished multimethods (not exactly what you're doing but related) POC I'll share in the evening, maybe there can be some cross-pollination of ideas :). --