Search
Monday, 26th of February 2018, 23:32:33 UTC
23:51:14
energizer
What's the difference between nil and 'nil?
23:52:27
Shinmera
One is the form NIL and one is the form (QUOTE NIL)
23:52:39
sjl
The first reads as the symbol nil, the second reads as the list (quote nil). When evaluated they result in the same thing, because nil is special and evaluates to itself.
23:53:34
stacksmith
What's interesting here is 'nil evaluates to nil too!
23:55:00
stacksmith
But it looks trickier, because nil is also a symbol - as well as type null.
23:55:23
energizer
Shinmera: (eval ''nil) is giving me nil i think
23:55:56
stacksmith
(subtypep nil 'symbol) => T
23:56:02
sjl
energizer: that's because ''nil is evaluated before it gets passed to eval
23:56:09
sjl
and then eval evaluates it AGAIN
23:56:23
sjl
(eval (read-from-string "''nil"))
23:59:56
pjb
(defpackage "MY-NULL" (:export "NIL") (:use)) (defconstant my-null:nil 0) (let ((*package* (find-package "MY-NULL"))) (list (eval (read-from-string "'nil")) (eval (read-from-string "nil")))) --> (my-null:nil 0)
0:00:06
pjb
energizer: it depends on *package*!
0:00:28
pjb
energizer: on the other hand: (let ((*package* (find-package "MY-NULL"))) (list (eval (read-from-string "'()")) (eval (read-from-string "()")))) --> (nil nil)
0:00:28
stacksmith
Nil is special: it's kind of like a keyword - a subtype of symbol that evaluates to itself. It is also considered a list with 0 items (listp nil) => t
0:00:45
pjb
energizer: but in this case, it depends on *readtable* where, the reader macros for ' and ( are defined.
0:01:07
pjb
energizer: you could change those reader macro to read something else than CL:QUOTE and CL:NIL.
0:01:29
stacksmith
Nil is a list, but it is not a cons: (consp nil) => nil
0:02:11
energizer
Shinmera: what's a form?
0:03:54
stacksmith
form n. 1. any object meant to be evaluated. 2. a symbol, a compound form, or a self-evaluating object. 3. (for an operator, as in ``<<operator>> form'') a compound form having that operator as its first element. ``A quote form is a constant form.''
0:05:35
stacksmith
energizer: try #clnoobs - it's a better place for basic questions about CL.
2:01:04
stylewarning
pierpa: id like to find a way to recreate latex source
2:01:41
stylewarning
I’m the one who helped get copyright reverted, and it looks like elsevier might have lost the source
2:08:18
pierpa
but thank you for helping this!
2:08:52
pierpa
stylewarning: I suppose you already asked PN?
2:37:08
igemnace
my notifications...
2:39:20
Bike
i thought we had uh, +t or whatever it is.
2:39:48
Bike
oh well. racists desperate to find new means of advertising their crap.
2:42:51
aeth
can someone search the logs to see how the +t was removed?
2:43:00
aeth
I'm not sure if any of the log sites keeps track of modes
2:43:23
p_l
aeth: we could search, but this is #lisp, the usual answer is "we didn't have mod on hand to update topic with new announcement"
2:43:54
p_l
I wonder if I could get staff to K-line the idiot
2:49:08
stylewarning
pierpa: I’m the one who helped get copyright
3:41:51
pierpa
stylewarning: I meant, if you asked PN about the sources. He lost them too?
4:21:16
pierpa
ok, he says he lost them :(
4:21:55
k-hos
I should be able to return values from a do loop in cl right?
4:23:19
k-hos
I am doing something wrong then
4:23:38
k-hos
because that would just be whatever the last form in the loop returns wouldn't it
4:24:11
pierpa
loop loops, there's no last form
4:24:41
Bike
when you say "do loop", do you mean the macro actually called "do", or something else?
4:25:16
Bike
here is clhs's description of do's syntax: " do ({var | (var [init-form [step-form]])}*) (end-test-form result-form*) declaration* {tag | statement}*"
4:25:19
Bike
see the result-form bit there
4:26:23
k-hos
I was trying from the statement section
4:26:52
Bike
documentation is important
4:28:41
k-hos
clhs is farily incomprehensible half the time unless you know the language
4:29:02
Bike
and it's explaind in the prose also
4:29:31
k-hos
doesn't change anything
4:30:20
pierpa
however, learners shouldn't have to go to clhs, and shouldn't be directed to it.
4:51:47
aeth
CLHS is... well, it's great as a reference, except for the examples
4:51:54
aeth
The examples are terrible to learn
4:52:07
aeth
s/to learn/to learn from/
4:52:29
aeth
Afaik, they're supposed to be interesting examples for implementers, not tutorial examples that build up to complexity.
4:52:38
aeth
s/up to complexity/up in complexity/
4:55:15
stylewarning
pierpa: of course i asked
4:56:24
pierpa
stylewarning: ok, supposed so :(
4:57:34
pierpa
CLHS is good when one knows 99% of what he wants to know and wants to know the remaining 1%
4:58:48
pierpa
and even then, it's not easy.
5:00:39
pierpa
it's not uncommon that even very expert long-time implementor misunderstand some things in the CLHS, go figure *learners* of the language.
5:11:15
Bike
ii'm just sayin it 's right there in the grammar
5:11:23
Bike
says "result forms" not "statement forms and also the result"
5:11:31
Bike
ain't some bullshit point about type corresondence
5:11:39
Zhivago
On the other hand, implementors have incentive to misunderstand things to conform with their long term preconceptions.
5:22:14
pierpa
Bike: yes, in this case was easy. but it's not always so.
5:33:40
pierpa
Norvig just replaced the pdf with "a much better version"
6:08:43
beach
Good morning everyone!
9:51:01
phoe
I am still amazed by good modular code
9:51:15
phoe
How fun it is to edit parts of it and still break nothing.
9:51:42
phoe
Like I wrote some code that I consider modular and with well defined protocols.
9:51:56
phoe
And I just decided to reimplement one thing while keeping its interface.
9:52:09
phoe
Boom, worked without a single error.
9:52:38
phoe
I poke my nose into code that I haven't touched for months and I can quickly remember how it works and edit it.
10:47:59
milanj
varjag, dexador connection cache looks suspicious to me (threads wise)
11:12:55
dxtr
So what's the bordeaux-threads equivalent of sb-thread:with-mutex?
11:17:11
Xach
scymtym: so there is a significant slowdown in 1.4.5-prerelease
11:17:27
Xach
scymtym: it takes 1.5 times longer than 1.4.4. i am looking at individual project timings now.
11:19:19
scymtym_
Xach: interesting, thanks. could we continue this conversation in #sbcl so we won't have to repeat everything for the others?
Tuesday, 27th of February 2018, 11:32:33 UTC