Post AuXMGgef8O2qPHnBUe by rwxrwxrwx@mathstodon.xyz
(DIR) More posts by rwxrwxrwx@mathstodon.xyz
(DIR) Post #AuVqHbtEwb2uE92zcO by screwlisp@gamerplus.org
2025-05-27T01:29:09Z
0 likes, 1 repeats
#programming #engineering #types #strongTyping #commonLisp #example https://screwlisp.small-web.org/programming/common-lisp-strong-typing-example/ for my friend @aleteoryx .Actually the #historicalNotes in the first paragraph of this article are a little explored key frontier in #computerScience , but the strong typing examples are simple ( etypecase and deftype.. satisfies for those in the know).I am personally still figuring out how typing in this manner does and can further connect to #typeTheory.
(DIR) Post #AuVqHjFTaJzZ38VLkW by screwlisp@gamerplus.org
2025-05-27T04:11:30Z
0 likes, 0 repeats
@pizzapal@mastodon.sdf.org @pizzapal@social.sdf.org do you know if #lisp 's cl-series is a type theory. I don't often describe things as type theories in practice so I am still trying to figure it out. Is any computational macro reasonably understable to be a type theory?@aleteoryx
(DIR) Post #AuVqHjFTaJzZ38VLkX by screwlisp@gamerplus.org
2025-05-27T01:31:13Z
0 likes, 0 repeats
BEFORE YOU SAY SO yes I unironically use the words 'strong typing' in full consciousness of the irony@aleteoryx
(DIR) Post #AuXMGeLnhXljGCx5oe by rwxrwxrwx@mathstodon.xyz
2025-05-27T02:00:31Z
0 likes, 1 repeats
@screwlisp @aleteoryx My preferred approach:(defun zero-to-20-only (x) (declare (type (integer 0 20) x) (optimize (safety 1))) :yes)
(DIR) Post #AuXMGfecr2QBIsldnU by jackdaniel@functional.cafe
2025-05-27T05:49:17Z
0 likes, 1 repeats
@rwxrwxrwx @screwlisp @aleteoryx The compiler may conformingly ignore type declarations. SBCL by accident has a policy to add check-type on type declaration, but in light of the spec it means "I hereby promise to always pass an argument of that type to this function, at a risk of nasal daemons if I do not abide"
(DIR) Post #AuXMGgef8O2qPHnBUe by rwxrwxrwx@mathstodon.xyz
2025-05-28T00:03:28Z
0 likes, 1 repeats
@jackdaniel @screwlisp @aleteoryx I see I've been relying on an idiosyncrasy of SBCL, thanks for pointing that out. Then @vnikolov's suggestion of using CHECK-TYPE is the portable option.
(DIR) Post #AuXMJun52BcB7JGjNg by screwlisp@gamerplus.org
2025-05-28T01:03:39Z
0 likes, 1 repeats
@rwxrwxrwx Oh yeah I failed to mention this. On one hand, our compilers purport to conform to ansi common lisp. On the other hand, ansi common lisp explicitly leaves many implementation details to be chosen by the compiler, and allows others in conforming compilers.So it's actually good that sbcl has these powerful features that are allowed by the standard, and they're even a sort of substandard in that they are traced back to cmucl. But it's non-portable.@jackdaniel @aleteoryx @vnikolov