freenode/#lisp - IRC Chatlog
Search
12:10:17
I729
those are the parallel versions, because in a SETQ you can set not just one parameter, but many, evaluated from left to right
12:11:37
I729
so (defvar x 1) and then (setq x 2 y (* x x)) gives y = 4 but (psetq x 2 y (* x x)) is y = 1
12:45:55
edgar-rft
If I remeber right (but I might be wrong) then SETF appeared when arrays came to Lisp somewhere in the 1960s, and at that time it was an acronym for SET Field (of an array) as some sort of syntactic counterpart to AREF. Because SETF was implemented as a macro it was later expanded to SET other places, too, including symbols, what means that today it can even be used instead of SETQ.
13:11:32
edgar-rft
In Common Lisp THE emphasizes that something is of a specific data type. (the fixnum 42) might signal an error if 42 is a float. Makes of course more sense if used with variables.
13:17:08
phoe
but you can go from strong dynamic typing into weak static typing - DECLARE TYPE and THE are tools for the job
13:18:42
I729
i know there is something on stackoverflow but for me with Haskell as my second main language I thought about how to make recursive algebraic data types
13:19:26
phoe
Lisp types cannot refer to themselves because Lisp types are mostly based on set theory
13:20:39
phoe
there is a loophole named SATSFIES that lets you do more creative things, but it comes at a cost - compilers cannot optimize those types well
16:57:10
flip214
with UIOP:launch-program, can I have arbitrary file handles passed on? Ie. create a socketpair or pipe and pass one end as FD 17 or whatever?
18:13:19
etimmons
flip214: not portably. All implementations I'm aware of either close all extra file handles without a way to override (e.g., SBCL) or pass all of them on without a way to override (e.g., ECL)
18:14:51
etimmons
But if an implementation allows you to configure that, you can add the necessary keyword args to UIOP:LAUNCH-PROGRAM. It passes all unknown args through to the implementation, IIRC