freenode/#lisp - IRC Chatlog
Search
9:08:56
jackdaniel
I think that brilliance of this enlightenment comes from the simplicity of the implementation
9:09:36
jackdaniel
(and that hardly can be said about clos) - that said if you look for the OOP abstraction clos is definetely better than ad-hoc closures
9:15:22
beach
shka__: By that, I meant that two different methods on the same generic function can be in two different files.
9:30:40
Spaceman77
jackdaniel: speaking of enlightenment, i've observed multiple people claiming that reading SICP/learning LISP grants you some enlightnment. I am curious about this.
9:31:49
Spaceman77
I have to agree that i find lisp-like syntax very ergonomic when writing programs
9:32:38
beach
LdBeth: No, because it would call read-char and read-char doesn't work on binary streams.
9:33:53
verisimilitude
It could have a LOAD-FASL function defined in machine code using, say, mmap, if it wanted to.
9:33:57
shka__
verisimilitude: it is probabbly very good approximation of actual state of the implementations ;-)
9:34:42
Spaceman77
beach: Well, i'm curious if you have experienced this `enlightnment`, and if so, how did it manifest? :)
9:35:16
verisimilitude
That makes me think about how WWW browsers have a ``webextensions'' API; defining something such as this is pointless, as it completely removes the ability for different approaches.
9:39:32
heisig
Spaceman77: For me, the enlightenment was 1. how little you actually need in a powerful language (functions + a few special forms) and 2. how treating data and code interchangeably solves A LOT of real-world problems.
9:42:53
schweers
Spaceman77: Also, having the language available at all times can be really great. Or put differently: not having the whole language available at all times seems to be seriously broken to me.
9:44:34
phoe
(with-lispcafe verisimilitude: there are worse ones - see http://bit.do/eeeeeeeeeeeeeeeee for example)
9:51:10
jackdaniel
Spaceman77: the most enlightening part would be the fact, that computers are just dumb devices manifesting programmer mistakes and lacks of cognitive abilities, but it is not directly related to lisp as a language
9:53:44
verisimilitude
I'll add my opinions, then. Lisp is a good programming language for when you don't know what you're doing, Spaceman77. If you only have a vague idea of the program you're writing, Lisp is a nice language that lets you delay lasting decisions rather far.
9:54:10
verisimilitude
If you later have a very good idea of what you're writing, Lisp can still be a good language, but isn't necessarily the best.
9:55:06
verisimilitude
Garbage collection lets you ignore memory management almost entirely, but it may become the case that you understand the memory model very well and so you gain from simply writing it out specifically, but you never must.
9:55:35
verisimilitude
Other languages do require you to do this, but this isn't a hindrance if you know what you're doing, of course.
10:36:16
Ukari
could :package-inferred-system work in the form of your-package.path.path.path.file instead of your-package/path/path/path/file ?
10:37:30
shrdlu68
Heh, the thing about Lisp letting you prototype if analogous to painting. Watercolors are infamously difficult to paint (all the more reason to admire people who actually master them). They dry too quickly, the water runs off and diffuses in weird ways, etc. Lisp, then, is like oil painting - it lets you play around.
10:50:33
schjetne
When I was a kid they made us paint watercolor on copier paper for art class. It's as if they set us up to fail, I still resent that.
10:54:05
no-defun-allowed
Oh yeah, I remember watercolours. We got oil paint later in the year, though.
10:54:56
no-defun-allowed
It was like jumping from Python to CL, I had something I could actually work with. (except I can't paint, and I got a D for art :)
10:58:43
schjetne
I'd rather compare it to Forth or APL. Very elegant, but hard to wrap your head around. I wish we had been given proper brushes, paper and actual useful instruction, because I love the medium and wish I knew how to do it. I think what they did to us was downright cruel.
11:20:43
schweers
Spaceman77: how do you understand a programming problem without attempting to solve it?
11:20:49
Spaceman77
When i worked half-time at my job, i found that i could write better solutions, because i had the time in-between to actually think about the whole problem
11:21:36
Spaceman77
schweers: Of course, you do it and bump into all the necessary roadblocks until you understand the problem
11:44:40
Ukari
I noticed that (defpackage foo (:use :cl)) will include all symbols exported by package :cl, which will cause name confilcts in some condition. for example, I could't (defstruct count) because there has been a function named count in package :cl. Is there any way to make (:use :cl) works with some stuff like (:exclude :cl :count) to save the name space?
11:47:39
shka__
however, it is usually better (in practical terms) to avoid conflicting with #:cl at the very least
11:50:11
splittist
alternatively, don't USE cl, and when you want cl:count or cl:signum, say so. Of course, this means you need cl:defun etc. But it's a style.
11:50:20
phoe
when I see SIGNAL then I expect that it's CL:SIGNAL - otherwise it causes me confusion
11:52:43
shka__
anyway, there are situations where this becomes useful, but as a rule of thumb you either use package (cl, maybe alexandria) or import just required symbols (other utils) or use a prefix (everything else)
12:22:17
White_Flame
how annoying. With just 1 of my cond clauses, I need to store the test value for use in the body
12:27:02
White_Flame
the definition of FOO would have to be somewhere above, and encompass much more than its use
13:08:43
makomo
White_Flame: take a look at On Lisp's CONDLET (i asked the same question ~2 weeks ago :-))
13:09:13
makomo
oh, actually, never mind, i also concluded that CONDLET doesn't fit what i wanted to do (which i think is the same as you're trying to do)
13:10:30
makomo
iirc, CONDLET conditionally establishes bindings and then executes a body, which is not what you're trying to do
13:13:13
White_Flame
but you'd have to declare var for every case. IT is simpler, but I guess less clean
13:14:02
White_Flame
really, we need specific macro support for every possible use, which would only lead towards NLP
13:18:17
White_Flame
ggole: there's no input data to pattern match against. it's an arbitrary predicate clause
13:18:54
White_Flame
unless you mean self-contained within the test clause, but then it doesn't encompass the value passing outside of that, and leaves you at square one
13:19:03
_death
abstractions have costs.. in my opinion it's better to use the setq idiom and concentrate on those with more bang for buck
13:19:31
White_Flame
one could consider an ad-hoc unabstracted setq idiom to be technical debt a well
13:20:27
makomo
i just remembered what i wanted to do with my COND. i wanted to reuse 2 values that were calculated as part of the test form, but not really the result of the test form itself
13:21:19
_death
White_Flame: sure.. throughout the years I've experimented with many styles.. and there was a time where I too preferred acond
13:21:54
shka__
https://github.com/sirherrbatka/cl-data-structures/blob/b2bdbb168ebcf24f1b5d74f8ff1438f40c9594c6/src/utils/macros.lisp#L4
13:23:21
White_Flame
if the value derivation is expensive, you absolutely want to defer until the actual test needs it, if it's conditionally reached
13:26:48
makomo
ACOND (and a hypothetical generalization of it that would allow every clause to have its own set of bindings) is nice, because the bindings are localized
13:30:33
White_Flame
for maximum insanity, a cond test clause could return a PROGV binding set applied to the handler body
13:56:35
dtornabene
curious if anyone has some strong opinions on the currently available xml libraries, I'm wanting to use them for parsing some webpages fwiw
14:20:32
Josh_2
I've done quite a bit with plump, I like but it does sometimes throw errors when passing 'normal' sites
14:28:35
splittist
I would plump for plump. But that may be because of ancient not-so-good experience with cxml. And I wasn't parsing web stuff.
17:59:12
drmeister
The docs say - Return a foreign pointer to VECTOR(including its header). VECTOR must be a vector created by MAKE-STATIC-VECTOR.
18:24:31
jmercouris
I want to go over some objects, manipulate them, and then collect some operations on them
18:26:56
jmercouris
I literally just wrote (loop for object in object-list do (method-call object) collect (accessor-call object))
18:32:06
ggole
(loop for i in (list 1 2 3 4 5) when (evenp i) do (incf i) collect i) vs (loop for i in (list 1 2 3 4 5) when (evenp i) do (incf i) and collect i)
18:33:35
jmercouris
I know they are much more common in C languages, but there are still use cases for flags in lisp, and I'm not sure how to name them
18:33:55
jmercouris
I have a database where I have a flag that indicates an account has been manipulated in some way that requires processing
18:34:04
verisimilitude
Also, you can avoid the AND if you just use END to delimit conditions, instead, which is what I use whenever something gets difficult to understand at a glance.
18:37:27
verisimilitude
I suppose an alternative convention would be is- or are-, as in ARE-TARGETS-CHANGED?
18:38:49
sjl
What airport are folks flying into for ELS this year? MXP, and then take public transit to Genova?
18:49:50
sjl
Yeah, not sure how efficient it'll be coming from the US though. There are direct flights from jfk <-> mxp at least. I'll poke around on ITA though
18:52:11
cage_
yes i also do not think there are direct flight form US, but it should not be a long journey from Milan to Genova
18:58:40
sjl
The US itself is within a few percent of the size of Europe. So when I'm looking at different cities on the map trying to figure out how to get to ELS I need to remind myself to calibrate my expectations properly.
19:00:05
surrounder
3.5 hours will get me in places where I won't understand anyone and the culture will probably be different too\
19:15:38
emaczen
the paste gives a backtrace showing where I call make-instance with several keywords and their corresponding arguments, and then two initialize-instance methods that are called, but the keyword arguments became nil...
19:16:16
emaczen
I write after methods on initialize-instance all the time, and I have never seen this happen before
19:19:00
emaczen
The only difference from my past usage of make-instance is that the object's class is a subclass of standard-class, but I've only overriden validate-superclass, and added an after method on ensure-class-using-class
19:38:31
sjl
... how in the hell can it possibly be six (6) USD per day to rent a car from MXP? Is Kayak lying to me? If so, heck, I'll just drive to ELS from MXP.
19:51:20
jmercouris
it appears more expensive on paper, but that is the true price, and they won't play games with you when it comes to insurance claims, upselling, and the like
19:52:36
sjl
I might rent a car anyway. I took the entire week off from work, so after ELS I might go to Florence and visit some of the math-related museums.
19:59:09
lumonom
Hey i am really new here so pls tell me if i do something wrong. I wanted to ask if there is an easy way to check if a float number only has a 0 after the decimal point
20:47:52
makomo
check out the section "understanding compiler diagnostics" or something similar in SBCL's manual
20:49:51
makomo
yeah, in any case, it's not seeing DEFTABLE as a macro but as a normal function, so it goes on to examine the arguments
20:50:02
jmercouris
I'm going to clear my cache and recompile on my own machine and see if I have issues
20:52:11
jmercouris
though it may be faster this time, since all of the dependencies are compiled, I'll do it as a last resort
20:58:52
dxtr
Can I do something like (loop for (a b) on '((1 2 3 4))) where (a b) has a length that depends on a variable?
21:00:47
makomo
dxtr: assuming arbitrary lengths, would you then access the destructured elements? you wouldn't know how many to destructure
21:01:38
makomo
LOOP's destructuring acts (almost, there's some corner case or something) like destructuring-bind's, so you can use stuff like &optional, etc.
21:01:50
dxtr
Well, if I could catch them as a list then that'd be great because that's essentially what I want to do
21:04:13
sjl
I don't think it's true that you can portably use destructuring-bind type stuff in LOOP binding clauses
21:04:38
sjl
Destructuring allows binding of a set of variables to a corresponding set of values anywhere that a value can normally be bound to a single variable. During loop expansion, each variable in the variable list is matched with the values in the values list. If there are more variables in the variable list than there are values in the values list, the remaining variables are given a value of nil. If there are more