freenode/#lisp - IRC Chatlog
Search
9:35:14
I729
I had to learn experimentally that if you do something like (make-array 3 :element-type '(integer 0 99)) also numbers up to 127 are allowed (which makes sense)
9:37:24
specbot
upgraded-array-element-type: http://www.lispworks.com/reference/HyperSpec/Body/f_upgr_1.htm
9:39:33
no-defun-allowed
oni-on-ion: It doesn't seem likely that the compiler will detect anything, if it upgrades the element type. Then a program that uses the array of that upgraded element type as suggested would work, but it's highly dependent on how types are upgraded.
9:42:20
no-defun-allowed
For example, I like having ELT, AREF and NTH because they communicate the complexity to the reader (AREF is O(1), NTH is O(n), ELT could be either) and as opposed to some names I've heard people puke out at university, long names are actually readable.
9:43:53
no-defun-allowed
But there are some fair points, like how GETF and GETHASH take arguments in different ways. And regular expression literals are hard (but we have CL-INTERPOL for regular expression literal syntax. And it's not my regular expression library.)
9:44:38
no-defun-allowed
Vectors are single-dimension arrays. Multiple dimensional vectors don't exist.
9:45:07
I729
or when you use the "#(" readmacro normal you do #(A B C) but in CL21 you can just if it is bound
9:48:13
no-defun-allowed
The first two commits I see are "Delete 'ed', 'room' and 'dribble' because they look useless." and "add standard-char to etypecase with convenience wrapper [as the splitting pattern for RE-SPLIT]". I use ROOM very frequently, and STANDARD-CHAR is _absolutely_ the wrong type to use.
9:49:07
no-defun-allowed
Try (typep #\¬ 'standard-char) — I would not expect to be able to split on #\Space, but not split on #\¬, even though I may rarely do the latter.
9:50:40
no-defun-allowed
I'm too good at complaining, so I'll stop there. But I don't think you should rely on how an element type is upgraded; and so if you give the element type (integer 0 99) to MAKE-ARRAY, don't try to put values that aren't (integer 0 99) into that array.
9:55:58
no-defun-allowed
beach: Silly question, would ROOM tell you how much disk space you have used on CLOSOS?
10:01:10
moon-child
(though of course purely in-memory allocators have fragmentation too. And buffered but as-yet unwritten data can still be considered part of an application's footprint. So it may not be worth covering those two in particular.)
10:01:46
no-defun-allowed
(But DRIBBLE and ED would be very handy; you'd have somewhat more permanent REPL logs, and with a nice environment ED, well, brings up an editor quickly. I think it says something if they're useless in a "modern" context.)
10:05:06
no-defun-allowed
It brings up an editor on a pathname or the site of a function definition.
11:53:56
srji
it seems everything has a meaning in lisp e.g. setq means set quote and "p" is a predicate
11:55:00
I729
yes, the committee invested much in designing it but also some is historically like CAR and CDR
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