freenode/#lisp - IRC Chatlog
Search
3:42:31
asarch
In HTML you could write: <meta charset="utf-8">, in net.html.generator:html you could: (:meta ...), however, how could you add the "chartset=utf-8" attribute to the tag?
4:02:30
no-defun-allowed
Does ql:register-local-projects not recurse into directories to find systems for anyone else on CCL?
4:28:13
PuercoPop
asarch: In spinneret it would be (:meta :charset "utf-8" ...). I imagine it would be the same in htmlgen
4:29:41
PuercoPop
the documentation of htmlgen says the attributes can be symbols or strings although they encourage keywords since "that looks more lisp like"
4:37:11
asarch
(net.html.generator:html (:meta (:body (:p "Hello world!")))) -> <meta><body><p>Hello world!</p></body>
5:01:12
PuercoPop
Yeah, this works on my machine: (net.html.generator:html ((:meta :charset "utf-8") (:body (:p "hello world"))))
5:19:56
random-jellyfish
(defvar *board* '( (2 'black) 'empty 'empty 'empty 'empty (5 'white) 'empty (3 'white) 'empty 'empty 'empty (5 'black) (5 'white) 'empty 'empty 'empty (3'black) 'empty (5 'black) 'empty 'empty 'empty 'empty (2 'white) )) (defun nth-slot (idx color) (if (eq color 'black) (nth idx *board*) (nth (- 23 idx) *board*))) (defun slot-pieces (idx color) (let ((slot (nth-slot idx color))) (if (eq slot 'empty) 0 (first slot))))
5:23:02
beach
random-jellyfish: This channel is dedicated to Common Lisp so it had better be Common Lisp.
5:29:49
beach
You need to study the rules of evaluation, and the definition of the special operator QUOTE.
5:30:48
beach
Since they are already inside a QUOTE special form, as indicated by the outermost quote, they are not in a position to be evaluated.
5:30:53
beach
You need to study the rules of evaluation, and the definition of the special operator QUOTE.
5:33:02
beach
Besides, symbols are considered names of functions only (with a few exceptions) when they are the first element of a compound expression. which is not the case here.
5:34:20
pjb
The only thing that quoting does is to read a list with two elements, the first one being CL:QUOTE.
5:35:05
pjb
(defvar *board* '((2 'black) 'empty) is read as (defvar *board* (CL:QUOTE ((2 (CL:QUOTE black)) (CL:QUOTE empty))))
5:35:31
pjb
so you see that if you evaluate this form, the variable *board* will be bound, if previously unbound, to the list ((2 (CL:QUOTE black)) (CL:QUOTE empty))
5:35:48
pjb
The second element of the first element of this list is a list of two elements: (CL:QUOTE black)
5:39:58
random-jellyfish
I understand quote changes the mode of evaluation, it switches from form mode to data mode
5:43:18
beach
random-jellyfish: As pjb said, when the READ function sees a ' character, it reads the expression that follows it, let say that expression is <expr>, then it returns (QUOTE <expr>).
5:44:58
beach
random-jellyfish: As you see, DEFVAR does not change the value of the variable if it already has one.
5:45:18
random-jellyfish
defparameter with a single quote before the first opening parenthesis? or no quotes at all?
5:47:26
beach
I suggest you get some rest then, then study the rules of evaluation in Common Lisp and then apply the new knowledge to your problem.
5:52:27
random-jellyfish
I noticed I understand better from analogies with other programming languages
6:18:12
jansc
Hi! Is there a CL library for converting a relative URL to an absolute URL, given a base URL? I'm looking for something like urljoin in python: urljoin('http://mysite.com/foo/bar/x.html', '../../images/img.png') => 'http://mysite.com/images/img.png'. Seems like purl and quri don't support this.
6:28:02
jansc
(merge-uris (parse-uri "../../images/img.png") (parse-uri "http://mysite.com/foo/bar/x.html"))
6:33:52
random-jellyfish
beach: thanks for that link earlier on form evaluation, sheds more light over my ignorance
12:44:46
LdBeth
Installed smartparens and I recall the reason last time I deleted that is I hate auto closing up parentheses which causes 1. hard to see how many parentheses I have to skip 2. REPL behavior annoying
12:46:15
beach
What if [ were to insert a [ as usual, and then when you type the ], the [ turns into ( and the ] turns into as many ) as required to close to [?