phoe changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <http://cliki.net/> <https://irclog.tymoon.eu/freenode/%23lisp> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/> | SBCL 1.4.14, CMUCL 21b, ECL 16.1.3, CCL 1.11.5, ABCL 1.5.0
<aeth> The advantage is that it's robust and people have generally settled on the fastest implementations with the most helpful compilers, but could switch if another one is better some day. The disadvantage is that you need multiple separate teams to implement features before you can really widely use them.
iovec has joined #lisp
<aeth> 10-20 years ago "everyone" (not really everyone) wrote for CLISP. Nowadays, "everyone" (again, not literally everyone, but most) writes for SBCL. That same code is now probably 10x faster with little to no porting work as long as people didn't use implementation-specific features.
quipa has quit [Read error: Connection reset by peer]
igemnace has joined #lisp
<aeth> But if you have some other need (like being easy to port to new platforms or running on the JVM) you can run a different implementation and it should be compatible with almost every library.
<aeth> To be fair, Clojure has two implementations that I know about: JVM and JavaScript. CL's implementation-based approach is much closer to C/C++, though. The advantage CL has over C/C++ is that with C/C++ different platforms have different preferred compilers so you have to deal with cross-OS *and* cross-implementation issues.
<aeth> With CL, there is no expectation to use $foo on $os1 and $bar on $os2 with the possible exception that CCL runs better on macOS.
umpc has quit [Ping timeout: 252 seconds]
<aeth> s/CCL runs better on macOS/CCL has better macOS support/
<aeth> Or something like that.
anamorphic has joined #lisp
<aeth> perryx: I hope that helps!
varjag has quit [Quit: ERC (IRC client for Emacs 26.1)]
<aeth> Lots of people will list features like reader macros, CLOS, etc., but what impresses me the most with CL is that there are multiple independent and healthy implementations that are library-compatible with each other (compare this with Scheme, which has as many or more implementations but is very fragmented) even though the CL community is fairly small
krwq has joined #lisp
Oladon has quit [Quit: Leaving.]
shifty has joined #lisp
nirved has joined #lisp
FreeBirdLjj has joined #lisp
wusticality has quit [Remote host closed the connection]
wusticality has joined #lisp
FreeBirdLjj has quit [Ping timeout: 246 seconds]
Mr-Potter has quit [Quit: Leaving]
dale has quit [Quit: dale]
Essadon has quit [Quit: Qutting]
Oladon has joined #lisp
wusticality has quit [Remote host closed the connection]
wusticality has joined #lisp
wusticality has quit [Ping timeout: 240 seconds]
wxie has joined #lisp
wigust has quit [Ping timeout: 246 seconds]
makomo has joined #lisp
wigust has joined #lisp
anamorphic has quit [Ping timeout: 250 seconds]
MichaelRaskin has quit [Read error: No route to host]
pierpal has joined #lisp
Denommus has quit [Remote host closed the connection]
Oladon has quit [Quit: Leaving.]
dddddd has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Ping timeout: 268 seconds]
wxie has quit [Ping timeout: 268 seconds]
keep_learning has joined #lisp
atgreen_ has joined #lisp
atgreen has quit [Ping timeout: 268 seconds]
nitrix has joined #lisp
Khisanth has quit [Ping timeout: 244 seconds]
<beach> Good morning everyone!
ebrasca has joined #lisp
ebrasca has quit [Remote host closed the connection]
wusticality has joined #lisp
wusticality has quit [Ping timeout: 246 seconds]
ebrasca has joined #lisp
Khisanth has joined #lisp
Josh_2 has quit [Remote host closed the connection]
marvin2 has quit [Ping timeout: 245 seconds]
zmv is now known as notzmv
xkapastel has quit [Quit: Connection closed for inactivity]
igemnace has quit [Ping timeout: 245 seconds]
nicdev has quit [Ping timeout: 240 seconds]
holycow has joined #lisp
nicdev has joined #lisp
akoana has left #lisp ["Leaving"]
ealfonso has joined #lisp
ealfonso8 has joined #lisp
smokeink has joined #lisp
perryx has quit [Quit: CGI:IRC (Session timeout)]
<ealfonso8> I'm having a problem building a dependency of my project from quicklisp, it might be a bug. Is there a way to ask quickload to load an older version of a library?
<ebrasca> When I try to compile with ecl I get "BINDING-STACK overflow at size 10240. Stack can probably be resized." .
<ebrasca> How I can fix it?
holycow has quit [Quit: leaving]
<ebrasca> It is :r1 instead of 0 to chose option ...
atgreen_ has quit [Ping timeout: 246 seconds]
atgreen_ has joined #lisp
torbo has left #lisp ["ERC (IRC client for Emacs 26.1)"]
FreeBirdLjj has joined #lisp
<beach> Wow, Alan Kay is a terrible speaker, but he is very smart and he knows many truths that he wants to communicate: https://www.youtube.com/watch?v=N9c7_8Gp7gI
<beach> And I was thinking about him saying that a web browser is a terrible idea.
<beach> Then I was thinking, how would a web browser be organized in the context of a Lisp OS?
<beach> Probably not as a single application, but as a set of "modules" that can be invoked independently from any other program.
FreeBirdLjj has quit [Ping timeout: 244 seconds]
<no-defun-allowed> Alan Kay is only good at smalltalk, not presentations.
<beach> Heh.
themsay has quit [Read error: Connection reset by peer]
themsay has joined #lisp
<beach> It's sad though. We need someone with all that knowledge and intelligence who is much better at communicating things.
wanz has joined #lisp
themsay has quit [Ping timeout: 246 seconds]
themsay has joined #lisp
makomo has quit [Ping timeout: 250 seconds]
nitrix has quit [Quit: Page closed]
<ebrasca> beach: Good video
<beach> Sort of, yes. Lots of good things to think about if you understand his point. But to do that, you either need to be as knowledgeable as he is, or you need to pause the video and go read up on some major subject for every few minutes of the video. I am certainly not as knowledgeable as he is.
Arcaelyx has quit [Quit: Textual IRC Client: www.textualapp.com]
FreeBirdLjj has joined #lisp
atgreen_ has quit [Ping timeout: 246 seconds]
PuercoPop has left #lisp ["rcirc on GNU Emacs 26.1"]
CrazyEddy has quit [Ping timeout: 272 seconds]
wusticality has joined #lisp
<ebrasca> beach: Do you undestand what he mean with "thresholds"?
rippa has joined #lisp
wanz has quit [Quit: wanz]
wusticality has quit [Ping timeout: 250 seconds]
wanz has joined #lisp
<beach> Well the term itself just means a value that is significant, so that anything below it is not enough, and anything above it is more than enough.
<beach> What he is saying is that we should compare our performance to some threshold that defines a value that is acceptable. We should NOT be happy with any incremental progress, if both before and after the progress we are way below the threshold.
<ebrasca> How do you determine this thresholds?
<beach> He doesn't say.
wanz has quit [Quit: wanz]
nowhere_man has quit [Ping timeout: 252 seconds]
dale has joined #lisp
rumbler31 has joined #lisp
<ebrasca> mmm blue destination
FreeBirdLjj has quit [Ping timeout: 245 seconds]
CrazyEddy has joined #lisp
<LdBeth> good evening
<phoe> What would be the idiom for "for a list, return a list that only contains elements of type FOO of that list"?
<phoe> (remove-if-not (curry #'eq 'foo) list :key #'typep) sounds way too verbose.
<phoe> ...and also won't work on subtypes.
<|3b|> (remove-if-not (rcurry 'typep type) list)?
<phoe> oh right, better
<phoe> thanks
<|3b|> or remove-if .. complement if you prefer
orivej has joined #lisp
* |3b| wonders why complement wants a function rather than a designator
<|3b|> 'notes' section suggests it should accept a designator
<LdBeth> backward compatibleness
<|3b|> with what?
<|3b|> http://www.lispworks.com/documentation/HyperSpec/Issues/iss172_w.htm says they are new to CL, and code shouldn'
igemnace has joined #lisp
<|3b|> shouldn't be relying on symbols erroring anyway
<LdBeth> >
<LdBeth> but they do exist in the T language.
krwq has quit [Remote host closed the connection]
sword has quit [Remote host closed the connection]
sword has joined #lisp
ggole has joined #lisp
<fiddlerwoaroof> I do wish COMPOSE made the cut
rumbler31 has quit [Remote host closed the connection]
mrcom has quit [Read error: Connection reset by peer]
shka__ has quit [Ping timeout: 272 seconds]
CrazyEddy has quit [Remote host closed the connection]
mrcom has joined #lisp
CrazyEddy has joined #lisp
orivej has quit [Ping timeout: 272 seconds]
refpga has quit [Read error: Connection reset by peer]
wusticality has joined #lisp
refpga has joined #lisp
wusticality has quit [Ping timeout: 246 seconds]
svillemot has quit [Quit: ZNC 1.6.5+deb1+deb9u1 - http://znc.in]
karlosz has quit [Quit: karlosz]
shka_ has joined #lisp
notzmv has quit [Ping timeout: 245 seconds]
leo_song has joined #lisp
<beach> This entry: https://dl.acm.org/citation.cfm?id=578775 mentions only Aho and Hopcroft, and not Ullman. Is the entry just wrong? I can even kind of see Ullman's name on the picture of the cover.
CrazyEddy has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
CrazyEddy has joined #lisp
<LdBeth> I guess so
FreeBirdLjj has quit [Ping timeout: 246 seconds]
orivej has joined #lisp
rumbler31 has joined #lisp
svillemot has joined #lisp
ggole has quit [Ping timeout: 252 seconds]
ggole has joined #lisp
nowhere_man has joined #lisp
<ggole> beach: might be a different edition
<LdBeth> nope, different editions gets different ISBNs
hiroaki has joined #lisp
<ggole> I meant the cover
<ggole> But other sites referencing that ISBN include all three names, so it's very likely just a mistake.
igemnace has quit [Remote host closed the connection]
scymtym has quit [Ping timeout: 244 seconds]
dale has quit [Quit: dale]
<pjb> beach: I don't know about Alan Kay worth as a speaker, I generally like his conferences. But for example at 23:00 he says that we still use tools designed 50 years ago (C++ compile link debug loop in programs emulating terminals emulating punch card), compared to other trades for which we developed nice graphical design tools. And here, I'd say that this is because text is more powerful than image.
<pjb> beach: text is more ergonomic, faster and more precise to give order or describe structures than GUI.
<pjb> The bandwidth with text is about symetrical (input/output). The bandwidth in GUI is very disymetrical, much faster for input (into the brain), much slower for output, even slower than text.
<aeth> pjb: I think that it's about being keyboard-driven when programming, not necessarily having no graphics.
<pjb> aeth: granted. It's nice if your command output graphics. It's not often necessary. We have tools to do that, stuff like GraphViz, various UML diagram drawing tools taking textual descriptions, etc.
<pjb> Only if you compare pre-canned orders in a menu selection, vs. a non-canned text command, the GUI will win. But it's slower to go to a menu and select the right item, than to type a few character to get the same result, when both commands a pre-canned.
<pjb> I still prefer emacs to eclipse… The later is too specialized, and too inconvenient to use.
<ggole> Text is more transportable, too
<ggole> eg, copy/paste Lisp code from old dialects and it will mostly work
<ggole> Or compiling the same source as a subset of two languages/language versions
ealfonso8 has quit [Ping timeout: 250 seconds]
<pjb> And more easily transformable, manipulable with simple character-based tools.
<pjb> Basically, when you have an IDE, a GUI design tool, whatever, what you have is a cow. You can make it produce calves, and you can spend a thousand years trying to make it evolve into planes. When you have a CLI with emacs, you deal at the atomic level, and you can reorder the atoms of your cow and make it into a plane or anything else whenever you want (as long as you know how to make a plane).
<flip214> applying "object oriented" thinking to text is also nice -- "select this paragraph", "move this () form", etc.
<pjb> Yes, but this is following the DNA program of the cow, only making calves and milk.
<flip214> as soon as the keyboard commands are muscle-driven (ie. used without actual thinking), you're on.
<pjb> It's not a toolbox, like unix CLI tools or emacs functions and commands are.
wanz has joined #lisp
<pjb> For example, emacs doesn't even try to optimize the bindings. For search and replace you have to type M-x replace-string RET … In a GUI you'd just type Command-R
wusticality has joined #lisp
patrixl has quit [Quit: ERC (IRC client for Emacs 26.1)]
rnmhdn has joined #lisp
<rnmhdn> I want to make a program but I'm so confused what is the proper way to handle something like this in functional programming.
mrcom has quit [Read error: Connection reset by peer]
wusticality has quit [Ping timeout: 268 seconds]
<rnmhdn> There is a graph. There is a list in each node. and there are some edges. each edge is a constraint for example it can require it's two sides to be equal.
random-nick has joined #lisp
<rnmhdn> or it can require it's two sides to always be null together so if the second element of the right side is null the second element of the other side should be null to but the other elements can be whatever number.
<rnmhdn> Here is the program I want to write:
<shka_> beach: do you regard highly of this book?
<pjb> 38:32 "Like the user interface that everybody uses these days, the GUI, that was my invention. I originally designed it for CHILDREN. I originally designed it that way because we have far more important things that we want them to learn. That user interface is not a good user interface for ADULTS. But in fact it's the one that adults wound up using because we made it easy for children to learn."
<shka_> beach: ullman is not listed in the book
<pjb> I don't know what is bad speaking in that!
<shka_> beach: sorry, it is
<shka_> Jeffrey D. UIIman
<rnmhdn> A fixed graph structure is given, and the data of some of the nodes is available so if I have 5 nodes. for example the data in 3 of the nodes is available. my program should be able to tell if there is anyway to assign some data to other 2 nodes so that all the constraints given by the edges would be satisfied
<|3b|> rnmhdn: in CL, if it isn't obviously recursive, just use an iterative construct. that's what they are there for :)
rumbler31 has quit [Remote host closed the connection]
<rnmhdn> CL?
<shka_> rnmhdn: 'functional' seems to have very blurry meaning
<shka_> rnmhdn: common lisp
<|3b|> oops, 'functional/mutable' rather than 'recurssive/iterative'
<rnmhdn> can you elaborate
<|3b|> (this channel is about CL, which doesn't worry too much about 'functional'or not)
<rnmhdn> how should I represent nodes and edges?
<shka_> rnmhdn: so you want to have immutable graph?
<rnmhdn> I don't care
<rnmhdn> I want to do it in the way people who do CL would do
<shka_> then what exactly you mean by "functional"?
<rnmhdn> :D
<rnmhdn> idk I thought lisp is a functional language
<rnmhdn> :D
<shka_> eh, not really
<|3b|> "lisp" isn't really anything concrete :/
notzmv has joined #lisp
<rnmhdn> but since I've started learning functional programming I see that there is a kinda different way of thinking in functional programming
<rnmhdn> And I'm not so used to that yet
<ebrasca> pjb: I like minimal GUI.
<rnmhdn> that's why I'm asking
makomo has joined #lisp
<pjb> rnmhdn: you have two choices. Either you want to solve the constraints globally, like a brain would do it. For this you need a recursive ANN, and there are pitfalls (getting stuck in a local extremum, thus not finding the solution). Or you will perform a systematic search with backtracking, starting from the constrained nodes, and progressing until all nodes are assigned a value.
<rnmhdn> what is ann?
<pjb> "Same thing for the iPad. The iPad is good for 2-yo and 92-yo and nothing in between" :-)
<pjb> ANN = Artificial Neural Network.
marvin2 has joined #lisp
<rnmhdn> I have two layers of problems:D
<rnmhdn> first thing is I don't know exactly how I should view this problem and how I should start programming it.
<rnmhdn> what I have is like 3 files
<rnmhdn> with the data of three nodes
<rnmhdn> and the structure of the graph is given
<rnmhdn> should I try to check the constraints edge by edge or should I check them all in parallel
<rnmhdn> I don't know how I should exactly approach this problem and what I should do with the missing nodes exactly
<no-defun-allowed> It'd probably be easier to go edge by edge, but you might have multiple solutions in some graphs.
<rnmhdn> I don't wanna just start coding and then have to rewrite the whole thing because I have a structural problem in my approach
<no-defun-allowed> You'd likely need some backtracking to make sure you test every possible solution, and you may end up with multiple solutions which satisfy all of the constraints.
<rnmhdn> let me make an example
<pjb> rnmhdn: backtracking means that you will need to generate families of results (lazily) and filter out the bad ones.
<pjb> rnmhdn: so for example from the graph: (2)----<from>=to>=0L>---->[x] you must return { (2)----<from>=to>=0L>---->[0], (2)----<from>=to>=0L>---->[1], (2)----<from>=to>=0L>---->[2] }
<pjb> I'll change the notation using a sexp to denote the constraint, sorry.
<pjb> So if you have (2)----(<= 0 to from)---->[x]<----(< from to)----(1), the above step will return: { (2)----(<= 0 to from)---->[0]<----(< from to)----(1), (2)----(<= 0 to from)---->[1]<----(< from to)----(1), (2)----(<= 0 to from)---->[2]<----(< from to)----(1) }, and the following step, will prune it to:
<pjb> { (2)----(<= 0 to from)---->[2]<----(< from to)----(1) } because the second constraint cannot be fulfilled for the fisrt two tries.
<rnmhdn> Here is a sample graph: https://ptpb.pw/-a3K.jpg
<pjb> Now, since a lot of potential solutions can be generated, we want to do it lazily.
<rnmhdn> and my input can be this:
<rnmhdn> a:(1,null, 100, null, 0)
<rnmhdn> b:(null,null, null, -15, null)
<rnmhdn> c:(1,null, 100, -15, 0)
<rnmhdn> pjb: but the problem is I have infinite number of possibilities it's not only 1 2 3
<rnmhdn> it can be any number
<pjb> Of course. So again, this is why it should be done lazily.
<pjb> You generate one, and go on with the rest of the process, until you backtrack (or you never backtrack, having found a solution).
<rnmhdn> can you tell me how my program should go about solving my example?
<rnmhdn> the one way arrow means the two sides should be equal
<pjb> Well, it's strange that you want to do it functionnaly, using lisp which doesn't have lazy evaluation natively.
<rnmhdn> the two way arrow between black node and b means they should be null at the same time
<rnmhdn> and as you can see I have no data for the black node here
JetJej has joined #lisp
<pjb> You're combining 3 or 4 difficulties at the same time. They're not extraordinarily difficult, but you have to know each of those problem and their solution well first, and then you may try to combine them in a lisp program.
<rnmhdn> so I have to see if there is any possible solution for the black node that would satisfy all constraints
<pjb> Or you can use haskell for the functional lazy evaluation first.
<rnmhdn> I don't know haskell. but I know some racket if that helps.
<pjb> but it's not functional.
<makomo> morning
<pjb> it's full of setf!
<rnmhdn> can you tell me how I should represent my graph
<rnmhdn> my nodes
<rnmhdn> and my edges?
<rnmhdn> for the example I sent
<pjb> rnmhdn: it doesn't matter.
<pjb> rnmhdn: just use a functional abstraction.
<rnmhdn> ok but what is your suggestion?
marcx has joined #lisp
<pjb> Once you get your algorithm running correctly, you can check the access pattern, and optimize the data structure used to represent your graph, keeping the same functional abstraction.
<pjb> My suggestion is that it doesn't matter.
<pjb> Just use a functional abstraction.
<rnmhdn> ok what functional abstraction should I use
<rnmhdn> for example I see that you have represented a graph as a dictionarry
<pjb> Well, if you want to walk the graph, what can be useful is to use adjacency lists. Ie. from a given node, have the list of edges starting from that node.
<pjb> So you could use something like: https://pastebin.com/WcejMFdp
<rnmhdn> thank you so much Pascal
<pjb> And since you want it functional, you will need (graph-replace-node-label graph node new-label) -> graph ; ie., you will generate a whole new graph just because you updated the label of a node.
<pjb> of course, since it's functional, you won't use mutation, so you can actually share structure between the new and the old graph.
<pjb> Also, when you use backtracking, it's a good thing, since then you can use again the old graph, to generate another new graph with another value for the node label.
<pjb> (mapcar (lambda (possible-label) (graph-replace-node-label graph node possible-label)) (all-possible-labels-for-to-nodes graph node))
<pjb> You need also "labels" one edges to store the constraints. (add-edge graph from-node to-node edge-label) -> edge (edge-label edge) -> label
FreeBirdLjj has joined #lisp
<pjb> What people look for in GUI, you can find it in genera and oberon (and MPW, and of course in emacs). It's basically that any text buffer can contain commands, and you can "click" or type C-x C-e with the cursor on that command to execute it. It's a variation of the REPL, basically.
FreeBirdLjj has quit [Ping timeout: 245 seconds]
ggole has quit [Ping timeout: 252 seconds]
ggole has joined #lisp
<pjb> So, in this talk Alan Kay presents half a dozen big idea. The main one here would be that to educate children, you need to put them in the world they will have to live 20-30 years later. To teach them French, put them in France. To teach them maths, put them in a Math World. To prepare them for their adult life, put them in the world as it will be in the future (which is the whole difficulty). We can try with sci-fi, but
<pjb> unfortunately, we're getting more of 1984 and Brave New World, than Have space suit, will travel or Star Trek.
MichaelRaskin has joined #lisp
<aeth> pjb: Well what everyone's being exposed to now is a lot of just-barely-not-gambling on iPads/etc. so the future is probably more like Las Vegas than 1984 or BNW.
<aeth> Not even just the game loot box stuff that you may have heard about. Lots of not-game apps have random reward stuff to increase engagement.
<pjb> No, everyone is exposed to the fake news from CNN et al. and siris, alexa and samsung smart tvs. This is pure 1984.
<aeth> pjb: You were talking about the software UIs children are exposed to. Children don't care about CNN.
<pjb> Everyone is exposed to assisted reproduction, surrogacy motherhood, artificial wombs; this is pure BNW.
<pjb> they don't have to care to be impregnated by it.
<p_l> unless you also have caste designation at the same time, it's not really BNW
<pjb> Oh, but you have it.
<verisimilitude> I agree; computing is in a poor state.
<pjb> And it's IQ-based, which is mainly determined by DNA.
<rnmhdn> I don't think IQ is mainly determined by DNA at all
<p_l> not iq
<verisimilitude> Erik Naggum put it well when he remarked how professionals use the same hardware and software others are expected to use and by noting how math would be if there were some need to dumb it down to train armies of unintelligent math workers.
<rnmhdn> I think it has much more to do with education and development
<pjb> rnmhdn: learn something.
<p_l> "caste" is mostly determined by your parents and environment
<verisimilitude> Intelligence is clearly heavily determined by genetics.
<verisimilitude> Everything else is, by a vast majority.
<verisimilitude> A tall person can have stunted growth, but a midget will always be a midget.
<p_l> but whether the base blueprint will "bloom" depends on environment
<pjb> The migrations promoted by the ONU (Marakech pact), have the effect of displacing low IQ white people (they become homeless, and die or at least don't reproduce), by low IQ black people. Ie. this increase the discrimination, the society becoming quickly BNW like.
<verisimilitude> Expand BNW.
<aeth> this should be moved to #lispcafe
<p_l> verisimilitude: Brave New World
<pjb> For a time, people thought that they could compenate IQ by education, and they realized how wrong they were; education benefit proportionnaly more to more intelligent people!
<pjb> Yes, sorry.
<verisimilitude> So, I've not bothered to prove this yet, but FORMAT seems trivially non-turing-complete.
<pjb> Yes.
<verisimilitude> I intend to write an optimizing FORMAT implementation.
<pjb> verisimilitude: notice for example, that sed(1) is not turing complete, but while true do sed … ; done is turing complete.
<pjb> verisimilitude: so it looks like FORMAT is not turing complete, but it also seem very close to be it. And anyways, there's ~/ so you have a hook to CL anyways.
<verisimilitude> I am always displeased when I MACROEXPAND something and find that LOOP may as well expand to SPECIAL-LOOP-PACKAGE:SPECIAL-LOOP-KEYWORD-DONT-TOUCH-FUCK-YOU; I'd prefer macros be written to expand to other symbols in CL as much as is possible.
<verisimilitude> Sure, but you can optimize in the vast majority of cases, pjb.
<pjb> verisimilitude: some implementation do it more than others. Try ccl or clisp.
<aeth> verisimilitude: well, the DO family usually does.
<pjb> Most macros can be expanded to a function call with thunks (anonymous functions).
<aeth> verisimilitude: I definitely agree with you, though. Seeing the final resulting tagbody/go in the iteration helps sometimes
<TMA> pjb: sed(1) is turing complete; you have conditions and conditional branches in sed (as well as unconditional branches), you can loop inside sed as well
<verisimilitude> I'd be interested in a FORMAT that always wrote the minimal needed. A trivial example is using PRINC and friends wherever something more complex isn't necessary, rather than always delegating to subfucntions that implement the full model.
<pjb> For example (defmacro IF* (test then &optional else) `(if* ,test (lambda () ,then) (lambda () ,else)))
<verisimilitude> I'd be interested in giving LOOP a similar treatment; these are a nice starting point for my own implementation of Common Lisp I want to write, since you can simply implement them in terms of everything else in CL.
<MichaelRaskin> I think most macros are technically allowed to be expanded to an implemetation-specific special form (with a string parameter, just to be mean)
<verisimilitude> They are, yes, MichaelRaskin.
<MichaelRaskin> I even complained about that in my talk about Agnostic-Lizard
<aeth> well if you were going to implement Lisp in hardware, you might not have a lower (software) level
<aeth> I'd be amused if someone did a hardware implementation of CL:LOOP
isoraqathedh has quit [Remote host closed the connection]
wigust has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #lisp
Lord_of_Life_ has joined #lisp
<|3b|> MichaelRaskin: the implementation-specific special form would have to have a valid macroexpansion, but /that/ could just be a call to a function with a string parameter :)
<p_l> aeth: most "lisp in hw" tends to have rather limited amount of lisp in hw ;)
<p_l> I think the SCHEME chip had the most
<p_l> (and obviously no loops)
FreeBirdLjj has quit [Ping timeout: 272 seconds]
atgreen_ has joined #lisp
<MichaelRaskin> |3b|: I don't think so; cl:loop must have an expansion. but nobody prohibits this expansion being ext:loop-impl (special form)
Lord_of_Life has quit [Ping timeout: 246 seconds]
Lord_of_Life_ is now known as Lord_of_Life
<|3b|> "An implementation is free to implement any macro operator as a special operator, but only if an equivalent definition of the macro is also provided. ", so that would be stretching things a bit
<|3b|> clhs 3.1.2.1.2.2
pierpal has quit [Ping timeout: 244 seconds]
<MichaelRaskin> |3b|: not that it never puts any constraints on the expansion
* |3b| thought there was something more general, but not finding it
<MichaelRaskin> The standard macros should have expansions, but nobody says they should be standard
<verisimilitude> The expansion of LOOP is constrained in some ways.
<MichaelRaskin> … and defun has a high chance to be indeed expanded to something interesting.
<|3b|> i'd argue that "expands to a special form" should be included in "implement .. as a special operator", but it is poorly phrased there
<verisimilitude> A LOOP must expand into a BLOCK and a TAGBODY.
<|3b|> LOOP can expand to anything
<verisimilitude> See this: http://clhs.lisp.se/Body/06_aad.htm
<MichaelRaskin> |3b|: I agree that it would be better if it was explicitly specified that all standard-defined macros used in portable code should expand into portable code
<|3b|> ah, true, it must contain a block and tagbody
<MichaelRaskin> Well, modulo implementation-specific fuctions
nowhere_man has quit [Read error: Connection reset by peer]
nowhere_man has joined #lisp
_whitelogger has joined #lisp
Zaab1t has joined #lisp
<pjb> The difference in reading capacity is genetic at 64%.
atgreen_ has quit [Remote host closed the connection]
atgreen_ has joined #lisp
wusticality has joined #lisp
<phoe> I love that thing when I need to operate on some body of code, like, wrap every element of that code with a list
<phoe> And I just copy it, jump to the REPL, do a quick MAPCAR, copy the result, paste it back into the code.
wusticality has quit [Ping timeout: 272 seconds]
Necktwi has joined #lisp
<|3b|> phoe: who needs repl, C-u C-x C-e in the source :p
wxie has joined #lisp
<phoe> |3b|: wait a second how does this work
<|3b|> C-u C-x C-e evaluates last expression and inserts result into buffere
<|3b|> so just type some code, C-uxe, then delete the code
<|3b|> (or comment it out if you might want to regenerate it, or whatever)
<|3b|> similarly C-- C-x C-e evals last expression and saves result to kill ring so you can paste it elsewhere
<phoe> ooooh
<phoe> awesome
orivej has quit [Ping timeout: 240 seconds]
orivej has joined #lisp
robdog_ has joined #lisp
xkapastel has joined #lisp
_whitelogger has joined #lisp
<pjb> phoe: I don't even go to the REPL, I do that in the lisp buffer in emacs, wrap a pprint around it, and type C-u C-x C-e
scymtym has joined #lisp
<pjb> Possibly (let ((*print-right-margin* 60 #| or 72 or whatever |#)) (pprint …))
<pjb> C-u C-x C-e also inserts the *standard-output* of the expression.
cage_ has joined #lisp
wxie has quit [Ping timeout: 245 seconds]
pierpal has joined #lisp
FreeBirdLjj has joined #lisp
<ebrasca> Do you know when Baggers make his streams?
rnmhdn has joined #lisp
FreeBirdLjj has quit [Ping timeout: 246 seconds]
hiroaki has quit [Remote host closed the connection]
hiroaki has joined #lisp
rnmhdn has quit [Ping timeout: 268 seconds]
robdog_ has quit [Remote host closed the connection]
isoraqathedh has joined #lisp
metallicus has joined #lisp
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Ping timeout: 240 seconds]
<phoe> ebrasca: you could ask him on #lispgames
wusticality has joined #lisp
<ebrasca> Is Baggers nick in irc someting like Baggers?
wusticality has quit [Ping timeout: 272 seconds]
<jackdaniel> ebrasca: yes, exactly that
<jackdaniel> afaik he is now busy with his game, you may track its development progress here: http://techsnuffle.com/
rumbler31 has joined #lisp
refpga has quit [Read error: Connection reset by peer]
refpga has joined #lisp
wanz has quit [Quit: wanz]
rumbler31 has quit [Ping timeout: 250 seconds]
wanz has joined #lisp
sakalli` has joined #lisp
sakalli` has quit [Remote host closed the connection]
sakalli` has joined #lisp
refpga has quit [Ping timeout: 250 seconds]
refpga has joined #lisp
void_pointer has joined #lisp
devon has joined #lisp
<devon> Optima, Trivia and other pattern matching libraries have does-this-node-match-this-pattern but seem to lack find-a-match-at-or-below-this-node, am I missing some wild-inferiors or similar feature?
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 245 seconds]
Lord_of_Life_ is now known as Lord_of_Life
devon has quit [Ping timeout: 250 seconds]
wigust has joined #lisp
devon has joined #lisp
metallicus has quit [Quit: WeeChat 2.3]
igemnace has joined #lisp
ravenousmoose has joined #lisp
smokeink has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rumbler31 has joined #lisp
Oladon has joined #lisp
rumbler31 has quit [Ping timeout: 250 seconds]
sakalli` has quit [Remote host closed the connection]
dddddd has joined #lisp
Bike has joined #lisp
ravenousmoose has joined #lisp
asarch has joined #lisp
varjag has joined #lisp
jinkies has joined #lisp
<phoe> find-a-match-at-or-below-this-node?
<phoe> could you show an example of how it would work?
wanz has quit [Quit: wanz]
wusticality has joined #lisp
<devon> ok...
wusticality has quit [Ping timeout: 246 seconds]
<devon> (,car . ,cdr) doesn't match (a b (c . d) e f)
<devon> (wild-inferiors (,car . ,cdr)) matches (a b (c . d) e f) binding car → c, cdr → d
<pjb> (destructuring-bind (car . cdr) '(a b (c . d) e f) (list :car car :cdr cdr)) #| --> (:car a :cdr (b (c . d) e f)) |# yep, it matches.
<devon> right, dreadful example
<devon> (42 ,car ,cdr) doesn't match (a b (42 c d) e f)
<devon> (wild-inferiors (42 ,car ,cdr)) matches (a b (42 c d) e f) binding car → c, cdr → d
shifty has quit [Ping timeout: 268 seconds]
chip has quit [Quit: chip]
jackdaniel has quit [Ping timeout: 244 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
pierpal has quit [Client Quit]
pierpal has joined #lisp
<ggole> Isn't that pretty normal? Pattern matching isn't tree search.
Josh_2 has joined #lisp
igemnace has quit [Ping timeout: 250 seconds]
Bike_ has joined #lisp
Bike has quit [Ping timeout: 256 seconds]
hiroaki has quit [Ping timeout: 245 seconds]
Bike_ is now known as Bike
pierpal has quit [Ping timeout: 245 seconds]
Lycurgus has joined #lisp
refpga has quit [Read error: Connection reset by peer]
refpga has joined #lisp
<phoe> How do I remove a function named (SETF FOO) from the Lisp image?
pierpal has joined #lisp
<phoe> oh right - fmakunbound
<phoe> I have a shadowed SETF, that's why it complained.
<LdBeth> GG
pierpal has quit [Ping timeout: 268 seconds]
scymtym has quit [Ping timeout: 268 seconds]
ggole has quit [Quit: ggole]
pierpal has joined #lisp
rpg has joined #lisp
<devon> Maybe "pattern matching" is more general than "tree search" but only a little.
<Josh_2> can someone tell me if there is a better way to do what I'm doing here. https://plaster.tymoon.eu/view/1100#1100 ?
<Josh_2> converting between 0-4 8 bit bytes into an int
<Josh_2> I always feel like I'm doing something wrong Q_Q
Bike has quit [Ping timeout: 256 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
<MichaelRaskin> Well, you could use a loop; it might be slightly slower (or might be not)
pierpal has quit [Read error: Connection reset by peer]
Lycurgus has quit [Quit: Exeunt]
FreeBirdLjj has joined #lisp
ntbre has joined #lisp
ntbre has quit [Client Quit]
serichsen has joined #lisp
pierpal has joined #lisp
devon has quit [Ping timeout: 252 seconds]
space_otter has joined #lisp
pierpal has quit [Read error: Connection reset by peer]
<_death> why do you have an array whose length can be 1 to 4 in the first place?
FreeBirdLjj has quit [Ping timeout: 245 seconds]
<asarch> Does X3J13 standard include file system support (rm, mv, mkdir, rmdir, etc)?
wusticality has joined #lisp
<phoe> asarch: yes
<asarch> Thank you! :-)
<phoe> delete-file, rename-file, ensure-directories-exist
* asarch takes notes...
Bike has joined #lisp
<Josh_2> _death: well it wasn't originally, it was always 4 but then I ran into issues where just bit shifting and logioring the values would work, until there were trailing 0's
<Josh_2> if there were trailing 0's I'd get outputs I don't want as the bytes are being sent from a Java client
sakalli` has joined #lisp
rumbler31 has joined #lisp
<_death> sounds like you don't fully understand the issue..
wusticality has quit [Ping timeout: 250 seconds]
<Josh_2> Well yeh probably
mingus has quit [Ping timeout: 252 seconds]
pierpal has joined #lisp
<_death> from the transcript at the bottom I am guessing the issue is little endian vs. big endian
<_death> you're getting big endian and have a little endian decoder
<phoe> sounds like something for fast-io
<phoe> it has read/write methods for be/le
<_death> (or rather, the other way around.. heh)
<_death> yes.. or nibbles
Essadon has joined #lisp
pierpal has quit [Ping timeout: 245 seconds]
<_death> don't use stack overflow for that
<Josh_2> Well it showed me the issue, because I do have to flip the order on 4 byte sequences like #(1 0 0 0) or I end up with huge numbers instead of just 1
<Josh_2> but when I get an input like #(23 4 5 23) I don't need to flip it
<Josh_2> or reverse it. And then when I get an input like #(0 0 34 45) it has to be #(34 45 0 0) not #(45 34 0 0)
<_death> that would be strange..
<_death> is the protocol well-defined?
<phoe> why do you get variable-length input
<Josh_2> I'm using BigInteger.valueOf(<whatever me int>).toByteArray(); to convert to bytes
<Josh_2> In Java
<_death> to, it uses big-endian.. so what do you pass to get an input like #(0 0 34 45)
<_death> *so
pierpal has joined #lisp
karlosz has joined #lisp
asarch has quit [Quit: Leaving]
<Josh_2> well sending 1080 gives me #(4 56 0 0)
<Josh_2> then if I bytes-to-int it without stripping the trailing 0's I get 70778880 (27 bits, #x4380000)
<_death> forget bytes-to-int.. first verify in the Java program that the array you get is #(56 4 ...)
<Josh_2> alrighty
space_otter has quit [Remote host closed the connection]
<Josh_2> well the Java is sending a byte array with 4 and 56
<phoe> which is good
<phoe> that is big endian
<_death> no
<phoe> (+ (* 256 4) 56) ;=> 1080
<_death> how do you know that it sends that array
<phoe> I guess they print it to screen or something
<Josh_2> That's how I recieve it
<Josh_2> and I printed the values to console
<_death> ...
<phoe> huh
<phoe> so there's also a network connection somewhere in the middle
pierpal has quit [Ping timeout: 250 seconds]
<phoe> in order to verify it, don't send it over the network, print it to console from the Java side
<Josh_2> I did
<Josh_2> That's how I verified it
<phoe> so it should be sending #(4 56)
Oladon has quit [Quit: Leaving.]
<Josh_2> nD[0] = 4 and nD[1] = 56 yes
<phoe> why do you explicitly read four bytes from there?
<_death> Josh_2: are you saying that you printed the array in the Java program and it showed 4 as the first byte?
<Josh_2> "Sent 4 56"
<phoe> _death: I guess so. big-endian is the "natural" order of writing digits where little-endian is the inverse
<Josh_2> System.out.println("Sent " + nD[0] + " " + nD[1]);
<phoe> so the number 123456 in big endian would be 123456 and in little endian would be 654321
<phoe> using decimal, of course
<Josh_2> usocket:socket-recieve requires that you either give it a buffer or a length of a buffer it will create
<Josh_2> so I chose 4 as an int is 4 8bit bytes
<Josh_2> that's why I end up with trailing 0's
<Josh_2> and the buffer you give it has to be a specific size already, you can't make it extendable so it'll fit just right
<Josh_2> I need a snickers
<phoe> why do you have a buffer like that if you accept variable-length data
pierpal has joined #lisp
<phoe> I mean, now you need code for buffering your input, too
<Josh_2> what
<phoe> buffering if it's too large and trimming if it's too small
<Josh_2> On the Java side?
<phoe> yes, bigintegers can be arbitrarily large so Java can send you something that is 9001 bytes long
<phoe> that's why they are big
<Josh_2> Well I know what my inputs are
<Josh_2> sort of
<phoe> how big are they?
<Josh_2> well whats the largest screen resolution you can think of, that's it
pierpal has quit [Read error: Connection reset by peer]
<phoe> d'oh
<phoe> two bytes are enough to represent a single size
pierpal has joined #lisp
<phoe> if you want to go this way, then you'll likely never get a screen that's larger than 65535x65535
<Josh_2> so two bytes all the time then
<phoe> and 65535 is a maximum value of a uint16
<Josh_2> Yes
devon has joined #lisp
<Josh_2> Well problem solved I suppose
<Josh_2> Thanks for the help :)
<phoe> no problemo
Necktwi has quit [Quit: leaving]
pierpal has quit [Ping timeout: 250 seconds]
jackdaniel has joined #lisp
pierpal has joined #lisp
themsay has quit [Ping timeout: 268 seconds]
jackdaniel has quit [Quit: leaving]
orivej has quit [Ping timeout: 240 seconds]
puchacz has joined #lisp
<puchacz> hi, can Lisp read integers with separator, e.g. 1_000_000 for million?
pierpal has quit [Read error: Connection reset by peer]
<phoe> write a custom function - the standard does not have anything like that AFAIR
<puchacz> phoe: would then integers have to be prefixed with a special character?
<puchacz> (I never wrote a reader macro)
<phoe> sure, it would work
<phoe> #i1_000_000 for example
<puchacz> ok, thanks
<puchacz> ah, but not plain integers, without a preceding character?
jackdaniel has joined #lisp
<phoe> nope - there is a well-defined syntax for reading those.
<puchacz> phoe: thanks
<phoe> well-defined, without any places for customization like that.
pierpal has joined #lisp
pierpal has quit [Ping timeout: 272 seconds]
pierpal has joined #lisp
pierpal has quit [Ping timeout: 244 seconds]
JetJej has quit [Quit: [Quit]]
notzmv has quit [Read error: Connection reset by peer]
Bike has quit [Ping timeout: 256 seconds]
notzmv has joined #lisp
rumbler31 has quit [Remote host closed the connection]
pierpal has joined #lisp
marvin2 has left #lisp [#lisp]
pierpal has quit [Ping timeout: 246 seconds]
marcx has quit [Quit: CGI:IRC (EOF)]
random-nick has quit [Read error: Connection reset by peer]
jasom has joined #lisp
rpg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
marvin2 has joined #lisp
rpg has joined #lisp
<phoe> woohoo, local setf-functions
<phoe> it's the first time I use them and I am satisfied
metallicus has joined #lisp
wusticality has joined #lisp
<LdBeth> why local?
kajo has quit [Ping timeout: 252 seconds]
<phoe> they basically call a different SETF function with a different set of arguments each
wusticality has quit [Ping timeout: 250 seconds]
devon has quit [Ping timeout: 250 seconds]
pierpal has joined #lisp
jlarocco has quit [Remote host closed the connection]
jonh has quit [Quit: WeeChat 1.9.1]
random-nick has joined #lisp
cage_ has quit [Remote host closed the connection]
kajo has joined #lisp
sakalli` has quit [Quit: ERC (IRC client for Emacs 26.1)]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
pierpal has quit [Ping timeout: 268 seconds]
pierpal has joined #lisp
metallicus has quit [Quit: WeeChat 2.3]
Zaab1t has quit [Quit: bye bye friends]
pierpal has quit [Ping timeout: 246 seconds]
<pjb> puchacz: you can put reader macros on [-+0-9] so that you can read 1_000_000 ; also on _, because I would admit _123_456.
shka_ has quit [Ping timeout: 244 seconds]
pierpal has joined #lisp
pierpal has quit [Client Quit]
pierpal has joined #lisp
pierpal has quit [Ping timeout: 246 seconds]
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orivej has joined #lisp
varjag has quit [Quit: ERC (IRC client for Emacs 26.1)]
rpg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
scymtym has joined #lisp
<no-defun-allowed> are there any fancy (human) language parsers like prolog-talk in quicklisp?
pierpal has joined #lisp
Mr-Potter has joined #lisp
themsay has joined #lisp
pierpal has quit [Ping timeout: 246 seconds]
<fiddlerwoaroof> I believe Grammarly released a NLP library
wusticality has joined #lisp
wusticality has quit [Ping timeout: 246 seconds]
<margaritamike> Anyone know how to pull out a comment with plump?
ravenousmoose has joined #lisp
ravenousmoose is now known as ravenousmoose[aw
ravenousmoose[aw has quit [Client Quit]
<no-defun-allowed> i'd like to take some english text, make it into a parse tree, and possibly turn it back later
Lycurgus has joined #lisp
atgreen_ has quit [Ping timeout: 240 seconds]
<no-defun-allowed> is there anything on using cl-nlp? i found tokenizing but just doing apropos on variable names doesn't seem too efficient
<fiddlerwoaroof> There are some links in the readme
<no-defun-allowed> i see
<fiddlerwoaroof> margaritamike: using lquery, it would be something like this: (lquery:$ (initialize "<html><!--foo--></html>") (children) (contents) (filter #'plump:comment-p))
<fiddlerwoaroof> lquery is a little dsl wrapper around plump that makes traversing xml a lot nicer
* margaritamike clicks
<margaritamike> ty
random-nick has quit [Read error: Connection reset by peer]
asarch has joined #lisp
refpga has quit [Ping timeout: 268 seconds]
refpga has joined #lisp
shifty has joined #lisp
mange has joined #lisp
Bike has joined #lisp
puchacz has quit [Quit: Konversation terminated!]
Lycurgus has quit [Quit: Exeunt]
rk[ghost] has quit [Ping timeout: 250 seconds]
rk[ghost] has joined #lisp
orivej has quit [Ping timeout: 272 seconds]
tempate has joined #lisp
akoana has joined #lisp
snits has joined #lisp
meiji11 has joined #lisp
rpg has joined #lisp
Arcaelyx has joined #lisp
<margaritamike> Are defvars evaluated before a ql:quickload?
<margaritamike> Please tell me no.
<margaritamike> Some weird stuff going on in this program.
djeis[m] has joined #lisp
<djeis[m]> Depends what you mean by evaluated, but no.
<margaritamike> I'm using (ql:quickload :drakma) at the tp of my file
<pjb> margaritamike: and do you compile this file?
<djeis[m]> What's the problematic defvar?
<margaritamike> and then assigning a (drakma:http-request ...) to a defvar a few lines later
<margaritamike> Yes compiling it
<djeis[m]> Ah, parsing error I guess?
<fiddlerwoaroof> margaritamike: you need an eval-when for that to work
<djeis[m]> The trouble is that parsing of the whole file happens before evaluation when you use compile.
<margaritamike> Why do I need an eval-when?
<djeis[m]> And packages are resolved during parsing.
<margaritamike> What should I use instead of defvar for my my variable to load up after quickload has finished importing the library?
<pjb> Indeed. ql:qiuckload is a function. This form is evaluated only when the file is loaded, not when it's compiled.
<djeis[m]> quickload is just a function.
<margaritamike> O_O
<pjb> defvar also has different compilation-time effect than load-time/run-time effects.
<pjb> also, defvar doesn't do anything when the variable is already bound.
<fiddlerwoaroof> Anyways, it's generally better to only have definitions as toplevel forms
<djeis[m]> You need the eval when if you want the ql:quickload to happen at compile time at all, which you do want because you need to be able to refer to the drakma package. That's why we usually use a build system like asdf to manage load-order lol
<margaritamike> Seems a bit silly to me
<fiddlerwoaroof> you can do something like sbcl --eval '(ql:quickload :dependency)' --load my-script.lisp --eval '(my-script-package::main)' --quit instead
<pjb> there's a reason why we define systems!
<fiddlerwoaroof> Or else, maybe try using sbcl --script instead?
<djeis[m]> You need the quickload to be evaluated before you compile the rest of the file is all.
<djeis[m]> And quickload is just a function.
<fiddlerwoaroof> I think that behaves more like python/ruby does
<pjb> Then asdf can take care of doing the things that need to be done at compilation time, vs. load-time.
devon has joined #lisp
<fiddlerwoaroof> (I haven't used it in a long time)
<no-defun-allowed> cl-earley-parser seems good enough for what i need, i just need to write the grammar and scrape a dictionary
<djeis[m]> If you use load directly that might solve the issue, because it might (I forget exactly...) evaluate each form before it even parses the forms afterwards.
<djeis[m]> But compile-file needs to parse the whole thing, and it won't go about evaluating stuff you haven't explicitly told it to.
X-Scale has quit [Ping timeout: 245 seconds]
<margaritamike> I just want to load a file into slime and have it execute what i tell it to sequentially. I don't want to have to learn asdf if it's not required right now. Still getting a hang of quickload and drakma.
<margaritamike> Does this execute properly for u guys?
<pillton> Then don't compile it. Just load it.
<margaritamike> If you put it in a file and try to load it into slime.
<margaritamike> Yes even M-x slime-load-file is not effective.
<pjb> 1- write an asd file!
<pjb> 2- don't do thing in toplevel forms.
<pjb> write a function, and call that function at run-time.
<fiddlerwoaroof> margaritamike: if you insist, you want to do this: https://fwoar.co/pastebin/3c2b5cd1ddb15117de83096eff495b3091ccc00d.lisp.html
<margaritamike> x_x
<fiddlerwoaroof> But, CL isn't meant to be used this way.
<djeis[m]> quickload isn't meant to be used from scripts like that is all.
<djeis[m]> It's just not designed with that in mind.
<djeis[m]> It's not like the import statement of python.
<pillton> margaritamike: You want defparameter instead of defvar if you want to continue working this way.
<fiddlerwoaroof> But, really, it's better to treat your repl like the unix shell
<fiddlerwoaroof> install dependencies, etc. there and use files to hold definitions
<pjb> margaritamike: https://pastebin.com/bd9Ewdhr
void_pointer has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
<margaritamike> defparameter worked out great
<pjb> But it may be not what you want.
<margaritamike> pillton: What is the difference between defvar and defparameter
<pjb> clhs defvar
<fiddlerwoaroof> defvar only defines the variable if it hasn't been defined yet
<margaritamike> I just want a variable to reference and pass the response on to a parser to search the DOM tree for random junk
<fiddlerwoaroof> defparameter redefines the variable every time
<pjb> margaritamike: write functions!
<margaritamike> o.o
<pjb> Even if you write a script, it's important to write functions, and to call the main function at the end, avoiding to do anything else at the toplevel.
<pjb> This is because scripts are read by buffer load, and if you are editing the script when it's executing, then you will read broken sexps across buffer boundaries!
<pillton> margaritamike: Are you using SLIME?
<Jachy> fiddlerwoaroof: I'd add #-quicklisp in front of the load, no need to load it again if you didn't run it as a script...
<margaritamike> Why was the compiler not smart enough to tell me any of this. I would not have figured this stuff out from the stacktrace it gave me.
<margaritamike> I'm happy I can keep going forward, though!
<margaritamike> pillton: yes!
<margaritamike> I'm new to CL and SLIME
<fiddlerwoaroof> margaritamike: the problem is you aren't really working the way CL expects you to work
<pillton> margaritamike: Ok. SLIME starts a single lisp machine with a global environment. This global environment is updated every time you compile and/or load a file.
<Jachy> margaritamike: What is it you want the compiler to tell you? Admittedly it's confusing at first to understand setf/defvar/defparameter and when it's appropriate to use them at the top level...
<pillton> margaritamike: The first time you loaded the file you pasted, a dynamic variable was created for *response* and the value returned by (drakma:http-request "http://lisp.org") was bound to the *response* variable.
tempate has quit [Quit: Leaving.]
<pillton> margaritamike: The second you loaded the file you pasted, the binding of the *response* variable was NOT updated because DEFVAR was used instead of DEFPARAMETER.
<pillton> The second time you ...
<margaritamike> Ahh
<margaritamike> Jachy: I'm not sure
<margaritamike> Ok ok -- onwards!
<pillton> margaritamike: From clhs defvar you see "defparameter unconditionally assigns the initial-value to the dynamic variable named name. defvar, by contrast, assigns initial-value (if supplied) to the dynamic variable named name only if name is not already bound."
<pillton> margaritamike: When in SLIME, you always have to remember that you are constantly mutating a single global environment.
<margaritamike> This is why it seemed like there was some weird caching issue going on I guess xD
JetJej has joined #lisp
quazimodo has joined #lisp
<aeth> The most useful use of defvar that I have found is for something like this: (defvar *cache* nil) and then later on in your program (if (and *cache* cache-p) *cache* (really-expensive-computation-that-takes-a-minute))
<fiddlerwoaroof> Or if you make a persistent connection that you don't want to lose
<Jachy> Stylistically (at least what i remember from PAIP) defvar indicates something meant to change in the running of the program with setf forms, defparameter indicates something more meant to change the overall behavior of the program, during the running it usually stays constant. i.e. a change to the parameter is a change to the program, while a change to a var is a change by the program.
<aeth> With *cache* you can repeatedly run/debug your entire program from the start while working on it without having to repeat the expensive part.
gxt has joined #lisp
Essadon has quit [Quit: Qutting]
quazimodo has quit [Read error: Connection reset by peer]
<fiddlerwoaroof> defvar also lets variable stay unbound (defvar *foo*)