newLISP has an approach to cons that I haven't seen before.
(cons 1 '(2)) => '(1 2)
(cons 1 2) => '(1 2)
If the second argument isn't a proper list, then cons behaves like the function list! https://www.newlisp.org/newlisp_manual.html#nil_and_true
(I have a soft spot for lisps that avoid improper lists.)
miniblog.
Related Posts
Terminad is a really interesting approach to rendering markdown in the CLI. It deliberately doesn't render links, so you can always see both the link text and the URL.
In a browser you have hover to see URLs, but not necessarily in a terminal.
Go has an elegant approach to defining example functions, which are shown in docs as `main()` with the output:
Really cute approach to reporting type errors: when there's a type error, show an example of a runtime error that the type check has prevented!
Data-Driven Techniques for Type Error Diagnosis https://escholarship.org/uc/item/59s4h4pv