freenode/#lisp - IRC Chatlog
Search
5:50:30
beach
A string is a specialized vector whose elements are of type character or a subtype of type character.
5:51:39
beach
Since NIL is a subtype of type character, a vector whose elements are of type NIL is a string.
5:55:59
loke
beach: Fair enough, but you have to admit that it's very unlikely that this was actually considered during the spec design.
5:56:53
|3b|
yeah, i suspect most implementations don't bother implementing arrays of type NIL in the first place
5:57:39
loke
ACTION thinks the spec should be implemented _exactly_ as written. No exceptions... (hold my beer while I submit a patch to fix the implementation PROG2
5:58:46
|3b|
(upgraded-array-element-type 'nil)=>T on (old version of) ccl here, so (make-array 0 :element-type nil) => #() instead of ""
5:59:59
|3b|
loke: don't forget to leave the limits at the lowest allowed values, like array-dimension-limit = 1024 :)
6:00:43
beach
loke: If you want to implement prog2 that way, I suggest you also erase the hard disk if AREF is given an object that is not an array.
6:02:37
loke
ACTION was about to suggest somethign silly with reagrds to charcter-fonts, but I now realise that that was dropped in CL
6:02:39
beach
loke: I didn't look at SVREF, but AREF takes an array, and the general rule is that the behavior is unspecified if that kind of restriction is violated.
6:03:44
loke
beach: Yes. I guess you're right... I was thinking that SVREF had some special provisions for that, but it appears that CL doesn't say anything about wrong types being bassed to any functions.
6:04:14
loke
Anyway, in CLtL2, a characer can have a "font" property. That property is just an integer.
6:04:59
jack_rabbit
I'm not too familiar with the ANSI organization, so it's possible this question includes some incorrect assumptions. I know that committes for lanugages like C release a new standard for their languages every decade or so, but Common Lisp seems not to have. What is the status of the Common Lisp standard committee?
6:07:19
jack_rabbit
That was my next question. :) But there must be people at ANSI who determine the legitimacy of such a committee, no?
6:08:09
beach
I mean, "yes", in that ANSI can refuse to make such a committee an official ANSI committee.
6:08:13
jack_rabbit
For instance, if I *did* set up such a committee, my standard would likely be a total disaster. Could I still push that through as CLtL3?
6:08:31
loke
Different standard organisations have different rules as well... ANSI is just the US standars body. Every countr has their own, and then there other other, global standards bodies like ISO or IEEE.
6:09:52
jack_rabbit
Ok. So it is democratized it the sense that its success or failure would largely depend on who, if anyone, actually used/implemented it.
6:15:03
loke
Have they come up with anything useful, ever? (except CORBA, which was useful for a moment in history)
9:06:35
mfiano
Does anyone know why Emacs/paredit insists on indenting the documentation strings of these two defgeneric forms differently on M-q? The second paragraphs are inconsistent. https://files.lispcoder.net/images/screenshots/img-20170918045634.png
9:08:16
jackdaniel
mfiano: it is not paredit but emacs, if you indent two first lines of the paragraph to the left, then the rest will follow
9:09:51
loke
mfiano: It should leave the string alone, unless you are inside the string when typing M-q
9:10:31
jackdaniel
try removinng two spaces before functionality in first docstring and do M-q after that (still havinng cursor in docstring)
9:11:02
mfiano
Yes, I am. I would like the string to be justified consistently. I am wondering what is causing that outdenting of the first line of the second paragraph in the first form.
9:11:51
jackdaniel
I'd say initial shape of docstring, not defgeneric or anything else causes different wrapping
12:09:52
minion
Xach, memo from phoe: https://github.com/phoe/fox5/blob/6d8f73882be6ddaf1f94d9a89153a38f1b0160fc/skippy.lisp
12:12:06
Xach
phoe: if i were doing it, i would make an object that was adjacent to the gif that produced rendered frames for a given image number.
12:55:57
dim
it used to be that you could export excel files to DBF format, which is better than CSV (anything would be better than CSV), and cl-db3 could then be used
15:25:16
Bike
wrote a lot of stupid programs, then progressively made them less stupid, until today when i have only kinda-dumb programs.
15:26:17
flip214
what's the trick to make READ-LINE return a BASE-STRING? I've tried :external-format and :element-type on OPEN, but without success.
15:29:06
flip214
phoe: I guess you want to point me to that part: > The primary value, line, is the line that is read, represented as a string
15:32:34
Natblida
beach, I understand the way programs work but I don't know the semantics of any language very much. In other words I don't know any language. A little bit of c and python, not something I'm proud of though.
15:33:27
minion
Natblida: look at gentle: "Common Lisp: A Gentle Introduction to Symbolic Computation" is a smoother introduction to lisp programming. http://www.cs.cmu.edu/~dst/LispBook/
15:34:08
minion
Natblida: please look at PCL: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
15:34:09
jackdaniel
Natblida: if you feel more like doing things (instead of learning the basics), you could jump into PCL
15:34:57
flip214
I quite liked reading SICP, and doing the exercises in Common Lisp instead... although that's one more hoop to jump through
15:34:59
beach
Natblida: Most people here recommend you use one of the major free Common Lisp implementations, and that you install and use SLIME with GNU Emacs.
15:37:10
Natblida
The thing with me is I've tried in the past on many programming courses online, like Harvard's CS50 which uses "C". But I get hooked up on the fine details, like how it actually works on a hardware level, things like that. That's a bad way to learn something I think.
15:38:09
beach
Natblida: I recommend you read assembly output from the compiler. I learn a lot that way.
15:38:20
flip214
Natblida: perhaps learning from the bottom up would help you, then, as these parts would already be clear and you wouldn't get distracted that much?!
15:38:59
flip214
CPU, then logic gates, transistors, FETs, ... if you go _really_ down the architectural ladder.
15:40:26
Natblida
beach, Thank you. I just wanna know what your process has been so far. Like how you started, how, etc.
15:40:39
larsen
Natblida: my (general) advice is to pick a project and complete it. this way: you have to learn a set of techniques that are likely to empower you doing different, possibly more complex/bigger things. you end up having a significant codebase that you can review while you learn more of the language (something that often doesn't happen with abstract exercises)
15:41:37
pjb
iqubic: it's definitely a good idea to learn how to write a small program in assembler.
15:42:33
pjb
iqubic: some processors are more fun to program than others, but it doesn't matter: you'll write only one application in assembler, for a life-long lesson.
15:43:00
pjb
iqubic: first/rest/endp means list. car/cdr/null means any kind of structured based on conses.
15:43:23
pjb
because it's the basic building bloc for lists and other kind of structures based on conses
15:44:30
pjb
you can make anything with them. trees, vectors, arrays, structures, objects, whatever.
15:45:31
pjb
iqubic: in lisp, there are 3 kinds of lists: proper-lists, dotted-lists, and circular-lists.
15:47:24
White_Flame
iqubic: cons cells are just 2-tuples. when you treat them like that, "first" and "rest" dont' fit the usage anymore
15:53:27
pjb
iqubic: cons cells don't matter. What matter is the functional abstractions you write above them!
15:54:25
pjb
(defun point (x y) (cons x y)) (defun x (pt) (car pt)) (defun y (pt) (car pt)) (defun rat (num denum) (cons num denum)) (defun num (rat) (car rat)) (defun denum (rat) (cdr rat))
15:55:24
pjb
(defun pt+ (p1 p2) (point (+ (x p1) (x p2)) (+ (y p1) (y p2)))) (defun rat+ (r1 r2) (rat (+ (* (num r1) (denum r2)) (* (num r2) (denum r1))) (* (denum r1) (denum r2))))
15:57:30
pjb
(list (pt+ (point 1 0) (point 0 2)) (rat+ (rat 2 3) (rat 4 5))) #| --> ((1 . 2) (22 . 15)) |#
16:42:59
pjb
(let ((array (make-array '(4 3) :initial-contents '((1 2 3) (4 5 6) (7 8 9) (10 11 12))))) (let ((v (make-array (reduce (function *) (array-dimensions array)) :displaced-to array))) (map-into v (function -) v)) array) #| --> #2A((-1 -2 -3) (-4 -5 -6) (-7 -8 -9) (-10 -11 -12)) |#
16:45:04
Bike
if you don't know the rank you can just use array-total-size and row-major-aref anyway.
17:45:00
some-user
how can i log and ignore condition in around method? (handler-case (call-next-method) (bla () (log))) interrupts chain of around methods
17:46:27
some-user
also Fare do you know if there is a video recording of recent icfp talk about gerbil scheme?