freenode/#lisp - IRC Chatlog
Search
0:23:04
mister_m
What causes (subseq "a" 1) to result in ""? If I try to access the character at that same position, it would result in an out of bounds error.
0:27:29
aeth
It's probably permitted to allow iteration that ends with "", which is sort of like list processing (a lot of those algorithms end on NIL)
0:29:12
aeth
This whole way of thinking kind of parallels car/cdr, except that it's not efficient (since SUBSEQ is consing up a new string each time)
0:33:05
saturn2
it's permitted for the start of a sequence bounding index to equal the length of the sequence
0:35:29
aeth
it makes sense because it's sequence-generic including lists, e.g. (subseq (list #\a) 1) or (subseq (list #\a #\b #\c) 1) not just (subseq "a" 1) or (subseq "abc" 1)
0:37:25
saturn2
i would say it avoids a class of special cases you'd otherwise need to check for, and just makes logical sense
0:40:01
saturn2
the length of a subsequence is always (- end start), whether or not start and end are equal
0:40:17
mister_m
thanks for the clarification; I've been doing a lot of car/cdr iteration lately and that sort of jumped out as a "huh" moment
1:40:32
skami
pjb: Thanks for the clarification ! That would indeed be a fun projet to add such a read-only feature
1:50:31
stylewarning
APPEND, like most lisp functions, prefers to get the job done with the fewest copies
1:51:29
no-defun-allowed
APPEND could get confused if it tried to copy something that isn't a list, e.g. in (append '(1 2 3) 'a)
2:22:07
stylewarning
no-defun-allowed https://usercontent.irccloud-cdn.com/file/oVbhetyu/1620094917.JPG
10:08:23
luis
madrik: well, you can go back if the upgrade broke your software, or you can have different software on different versions of the quicklisp distribution
11:57:08
drmeister
Xach: We've been running a "quickclasp" server to distribute stuff specific to clasp - it's been working well.