libera/#lisp - IRC Chatlog
Search
19:44:01
earl-ducaine
Style question: CLHS occasionally uses (VALUES) rather than NIL. e.g. (READ S NIL (VALUES) T) Does this ever make a difference? If not, is it still used as a convention to distinguish various types of NIL?
19:49:57
jcowan
Returning NIL is returning one value, namely NIL. Returning (VALUES) is literally returning zero values. In contexts where a value is demanded, zero values will be silently coerced to a single value, namely NIL, but in the REPL, zero values is normally shown by printing nothing, whereas a single value NIL is shown by printing NIL or ().
19:53:01
grawlinson
managed to grab a tarball of html-encode, but it's not ideal relying on quicklisp :(
19:54:57
earl-ducaine
jcowan: awesome explanation. Just noticed the side-effect in the REPL. Makes perfect sense to use that notation in the context of READ. Thansk!
19:55:07
jcowan
The argument to a function is a context demanding exactly one value (not always true of macros), so I have no idea why anyone would write (VALUE) instead of NIL for the eof-values argument to READ
7:08:27
problemkatze
hi everyone, i just want to ask a question regarding CL, ive tried to look online but i cant find what im looking for, my question is, is there a way to declare multiple global variables in CL like a one liner instead of typing multiple defvar/defparameter/defconstants?
7:08:28
problemkatze
i was thinking multiple-variable-bind function but i cant seem to find a sample of it ive tried it the Racket Scheme way but it doesnt and im not even sure it can be used for this,
7:10:04
wasamasa
you use define-values for some form producing multiple values, not an artificially created one
7:10:56
wasamasa
go look at some actual scheme code and you'll find everyone just writes several lines
7:11:13
wasamasa
in the rare case they have to deal with some code only producing multiple values, they may reach for define-values
7:11:28
problemkatze
ok so its possible in CL afterall i was curious cause i saw the multiple-variable-bind lol