[dylan] Function types in Dylan 2016
Bruce Mitchener <[email protected]> Fri, 1 Aug 2014 09:02:35 +0700
| Newsgroups | gmane.comp.lang.dylan.gwydion.devel |
|---|---|
| Message-ID | <CA+esKjOj-soUdKjBFOqa+VoMh3XLe=nvrxePY8cEe_RKdaRw1g@mail.gmail.com> |
--===============0670836888==
Content-Type: multipart/alternative; boundary=f46d04430610738e1104ff87c816
--f46d04430610738e1104ff87c816
Content-Type: text/plain; charset=UTF-8
As some of you are aware, I've been writing about function types in Dylan
2016 lately. I've made that post public now:
http://dylanfoundry.org/2014/08/01/function-types-and-dylan-2016/
Comments and thoughts are welcome.
I've also got a branch where I've started to implement this. If there's
interest, I can share it more widely.
I don't have support for any compile time checking yet or the new syntax,
but the following correctly results in a run-time error (due to a missing
#rest in the function type) on my branch:
define function main
(name :: <string>, arguments :: <vector>)
let lfts = make(<signature>, required: vector(<string>), values: #[]);
let lft = limited(<function>, signature: lfts);
let f :: lft = format-out;
f("Hello, world!\n");
exit-application(0);
end function main;
main(application-name(), application-arguments());
- Bruce
--f46d04430610738e1104ff87c816
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">As some of you are aware, I've been writing about func=
tion types in Dylan 2016 lately. =C2=A0I've made that post public now:<=
div><br></div><div>=C2=A0 =C2=A0=C2=A0<a href=3D"http://dylanfoundry.org/20=
14/08/01/function-types-and-dylan-2016/">http://dylanfoundry.org/2014/08/01=
/function-types-and-dylan-2016/</a></div>
<div><br></div><div>Comments and thoughts are welcome.</div><div><br></div>=
<div>I've also got a branch where I've started to implement this. I=
f there's interest, I can share it more widely.</div><div><br></div>
<div>I don't have support for any compile time checking yet or the new =
syntax, but the following correctly results in a run-time error (due to a m=
issing #rest in the function type) on my branch:</div><div><br></div><block=
quote style=3D"margin:0 0 0 40px;border:none;padding:0px">
<div><div>define function main</div></div><div><div>=C2=A0 =C2=A0 (name :: =
<string>, arguments :: <vector>)</div></div><div><div>=C2=A0 le=
t lfts =3D make(<signature>, required: vector(<string>), values=
: #[]);</div>
</div><div><div>=C2=A0 let lft =3D limited(<function>, signature: lft=
s);</div></div><div><div>=C2=A0 let f :: lft =3D format-out;<br></div></div=
><div><div>=C2=A0 f("Hello, world!\n");</div></div><div><div>=C2=
=A0 exit-application(0);</div>
</div><div><div>end function main;</div></div><div><div><br></div></div><di=
v><div>main(application-name(), application-arguments());</div></div></bloc=
kquote><div><br></div><div>=C2=A0- Bruce</div><div><br></div></div>
--f46d04430610738e1104ff87c816--
--===============0670836888==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
hackers mailing list
[email protected]
https://lists.opendylan.org/mailman/listinfo/hackers
--===============0670836888==--