freenode/#lisp - IRC Chatlog
Search
13:51:36
flip214
has someone cl-yaml working in windows? for me the self-tests crash already (with sbcl 2.0.11)
14:19:17
flip214
phoe: when loading a 1200 byte file it says "invalid octet at 420000000" or something to that effect
14:28:43
phoe
jmercouris: the original LISP had a thing called LABEL that was basically a named local function
14:29:25
phoe
labels were able to refer to one another; flet is just let except in the function namespace
14:32:13
pfdietz
I want to expand sets of patterns to methods, but I can't do that in a flet-like way.
14:32:16
jackdaniel
every person who looks at your code will wonder what is fletrec and why it was introduced
14:32:42
jackdaniel
and the explanation "I don't like the standard operator name" isn't a very convincing argument
14:34:52
Nilby
I think most these decisions were argued to death in the 10 or so years of the CL committee, balancing for compatibility and aesthetics. I think one can still read the the old mailing list and the committee notes.
14:44:11
jackdaniel
no, I'm just making a joke regarding "impact" of the discussion whether you like caddddr or not (n.b, using such operations is discouraged in norvig's style guide, and in numerous other places)
14:51:10
jackdaniel
however it doesn't buy you much because you need to traverse the list (instead of modifying the last cons)
14:51:50
jackdaniel
with the cmu's collect macro you have the collecting decoupled from loop, so you may collect "anywhere", but that's another story
14:53:08
jackdaniel
(there are multiple derivatives and copycats of this macro in quicklisp, i.e in the cl-collectors library - I think that this was its name)
14:53:55
jackdaniel
either something with scoping or with multiple collections not working as expected, so I'd rather discourage from using it
14:58:10
Nilby
I don't know what optimizations loop does, but isn't it better just to push and nreverse at some point?
15:00:14
pfdietz
The rplacd approach uses a dummy head cons cell, but that can be stack allocated w. dynamic-extent.
15:02:57
splittist
phoe: thanks. How do I use that to look for, e.g., command line processing libraries?
15:04:55
Bike
pfdietz: the thing with generic-flet is that defining and undefining methods later is less relevant, and that's a lot of the appeal of clos. if your set of methods is static, can't you just use typecase?
15:05:59
phoe
splittist: I have no idea, actually. how would you do that with quickdocs? AFAIK it only gave you autogenerated documentation
15:09:29
splittist
phoe: thanks. (I have you in my headphones talking about control flow, too. Strange feeling.)
15:21:53
Nilby
splittist: I got results of (apply-argv cl-cli cli-parser net.didierverna.clon.core command-line-arguments configuration.options-source-commandline hu.dwim.util/command-line com.google.flag ufo unix-options unix-opts utility-arguments) from an older quicklisp dist.
18:50:13
phoe
#lisp is about mostly-on-topic Common Lisp discussion, #clschool is about learning Common Lisp, #lispcafe is a mostly-off-topic hangout
19:00:35
aeth
"Lisp" can mean "Common Lisp" (e.g. the .lisp extension) or it can mean "the Lisp family of languages"
19:01:22
aeth
There aren't really a lot of Lisps that aren't something else more than they're Lisp (e.g. Schemes) so it's not particularly useful to talk about Lisps as a whole.
19:02:43
aeth
Common Lisp is called "Common" Lisp because it should be able to run most historic Lisp programs (including Emacs Lisp, which is intentionally archaic, even though it came after Common Lisp) with very little, if any, modification.
19:03:56
aeth
Most other Lisps represent a radical break in compatibility, with the possible exception of Scheme, which still renames practically everything.
19:05:57
aeth
For perspective, sometimes people come here with Emacs Lisp questions and it takes a while to find out that it's not in fact a question about Common Lisp code.
19:28:24
jmercouris
any way to do some operation like 'push' but where I can actually individually push all the elements?
19:30:06
Bike
jmercouris: i mean, push is just setf x under the hood. you can use define-modify-macro to get appendf, or else i think alexandria has it
19:30:58
Bike
...er, would that work, or would it try to modify the quoted list? maybe that wouldn't work
19:35:50
adlai
jmercouris: I realize your example for this was only an example; however, I hope that you are aware that all these examples modifying quotes structure are undefined behavior.
19:48:25
_death
though that may be a bit ambiguous.. should it be (3 4 2 ...) or (2 4 3 ...) so I'd say (preferf operator 'prependf)
19:51:08
adlai
ACTION wonders how much downstream technical debt depends upon chanl's current behavior; a quick glance through quicklisp metadata shows that it does have a few dependants
19:52:56
adlai
amusingly enough, not one of the dependencies are libraries that I'd heard of, before checking.
20:31:47
lotuseater
hi there, i wanna make a read macro with #\⍳ that reads in stuff like "⍳5" and produces (loop :for i :from 1 :to 5 :collect i). up to now i only made read macros with read-delimited-list
20:34:30
sjl
I'd just use `read`, then you could make ⍳(1+ foo) read as (loop for somegensym from 1 :to (1+ foo) collect somegensym)
20:35:48
sjl
well, I'd probably make it read as `(alexandria:iota ... :start 1)` instead of a loop form, but you get the idea
20:37:38
sjl
No, you'd need to make your own function that calls read to read in the next form, then returns the form you want
20:41:12
sjl
except instead of returning (list 'quote (read ...)) you return `(alexandria:iota ,(read ...) :start 1)
22:48:22
adlai
ACTION wonders whether anyone suggested to github that they parse dependency information from .asd files
22:49:29
adlai
whereas once their easy excuse not to, the absence of a package manager, is gone, they could now just blame the lack of standardization on any single one.
23:04:06
phoe
there's nothing even close to it in terms of popularity and use nowadays, and most of these other utilities parse .asd files anyway.
23:05:55
phoe
it handles the part where you declare dependencies and it ensures that they are loaded; that's the context that GitHub might want to care about in this context
23:08:44
adlai
ACTION used the word 'package', in 'package manager', with the connotation it has in the linux world, of locating and installing external libraries; as opposed to the parts that are entirely within ANSI CL
23:09:58
adlai
lol, at one point, wasn't asdf-install doing text searches of cliki to locate tarball urls?
23:31:52
lotuseater
adlai: i learned some time ago it was the first .com domain in 1985 :) and the ones after that also companies with relation to LISP (machines)
23:36:08
surabax
lotuseater: The first web site of the US White House was powered by CL-HTTP and Statice running on a Symbolics Lisp machine, iirc
23:40:23
cl-arthur
lotuseater: maybe you'll enjoy https://lisper.in/reader-macros, it's the tutorial someone recommended me when I first had a problem addressable by a reader macro.
23:42:45
lotuseater
i read up to now to that topic (not everything) in On Lisp, Let over Lambda and https://gist.github.com/chaitanyagupta/9324402
23:45:16
lotuseater
did you get my reference last week? https://en.wikipedia.org/wiki/Knights_of_the_Lambda_Calculus
23:46:28
cl-arthur
I didn't, so I ended up reading the wikipedia entry and some other website too :)
23:47:22
lotuseater
ok good. it came to my mind again because Arthur was one of the Knights from the legend
23:52:48
lotuseater
so to have a readmacro for writing lists (aka vectors) like in Haskell i alter the readtable after going into (set-macro-character #\[ ...) so i can have something like [2,5..100] ?
23:55:51
Bike
anyway, reader macros get a handle to the stream and can read whatever they want and interpret it however they want
23:56:37
lotuseater
listcomp would be something like [ x + y | x <- [1..100], y <- [1..100], x+y == 10]
0:00:40
moon-child
no-defun-allowed: true, but their strings are [Char], which has caused endless consternation
0:00:56
lotuseater
Bike: but what didn't fit in my head yet is when I do READ-CHAR but also want to jump back how to do it
0:01:54
lotuseater
moon-child: yes it is awful (but can for simple stuff also be useful) newer libs like RIO are better if you don't like that or the hole Prelude
0:03:21
cl-arthur
read-char -> peek-char -> unread-char. now you know the next two chars in the stream XD
0:04:34
lotuseater
yeah and you can give peek-char a char, but if it's not found it seems to throw me to the debugger
0:08:23
no-defun-allowed
(peek-char peek-type) accepts peek-type = NIL to peek the very next character, = T to peek at the next non-whitespace character, and a character to peek at the next character char= to that one.
0:21:45
no-defun-allowed
I think that is the generic function you can use with Gray streams to implement PEEK-CHAR.