jeosol has quit [Quit: Ping timeout (120 seconds)]
macdavid313 has joined #lisp
macdavid313 has quit [Ping timeout: 246 seconds]
macdavid313 has joined #lisp
hhdave_ has joined #lisp
Krystof has quit [Ping timeout: 256 seconds]
tomaw has quit [Quit: Quitting]
Alfr has quit [Remote host closed the connection]
ane has quit [Ping timeout: 256 seconds]
Alfr has joined #lisp
tomaw has joined #lisp
ym has quit [Ping timeout: 256 seconds]
hhdave has quit [Ping timeout: 256 seconds]
hhdave_ is now known as hhdave
ym has joined #lisp
[d] has quit [Ping timeout: 264 seconds]
[d] has joined #lisp
ane has joined #lisp
macdavid313 has quit [Ping timeout: 264 seconds]
moon-child has joined #lisp
zacts has quit [Quit: leaving]
dbotton has quit [Quit: Leaving]
akoana has joined #lisp
karlosz has quit [Quit: karlosz]
kaftejiman has joined #lisp
devon has quit [Ping timeout: 246 seconds]
_whitelogger has joined #lisp
Alfr_ has joined #lisp
<beach>
Good morning everyone!
torbo has quit [Remote host closed the connection]
Alfr has quit [Ping timeout: 260 seconds]
Alfr_ has quit [Remote host closed the connection]
Alfr_ has joined #lisp
kini has quit [Remote host closed the connection]
kini has joined #lisp
hdasch has quit [Quit: ZNC 1.7.2+deb3~bpo9+1 - https://znc.in]
hdasch has joined #lisp
Alfr_ has quit [Remote host closed the connection]
Alfr_ has joined #lisp
Alfr_ has quit [Remote host closed the connection]
Alfr_ has joined #lisp
Alfr_ has quit [Client Quit]
__jrjsmrtn__ has joined #lisp
zaquest has quit [Remote host closed the connection]
_jrjsmrtn has quit [Ping timeout: 264 seconds]
_whitelogger has joined #lisp
elflng has joined #lisp
karlosz has joined #lisp
galex-713 has quit [Ping timeout: 272 seconds]
galex-713 has joined #lisp
judson_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Dizidentu has quit [Quit: Connection closed]
judson_ has joined #lisp
galex-713 has quit [Ping timeout: 246 seconds]
galex-713 has joined #lisp
andreyorst has joined #lisp
waleee-cl has quit [Quit: Connection closed for inactivity]
jeosol has joined #lisp
mrcom has quit [Ping timeout: 265 seconds]
kini has quit [Remote host closed the connection]
kini has joined #lisp
mindCrime has quit [Ping timeout: 264 seconds]
_whitelogger has joined #lisp
skapate has joined #lisp
skapata has quit [Ping timeout: 272 seconds]
<ey[m]>
what do you all think of those who say that lisp is hard to read ?
<pranavats>
Depends on the difficulty they are facing.
<beach>
Any unfamiliar language, natural or artificial, is hard to read.
<beach>
ey[m]: But it is not intrinsically harder to read than anything else.
<ey[m]>
the major concern those people have are the huge amount of parens when closing many nested expressions
<beach>
To me, C++ is incomprehensible, but that's because I am unfamiliar with it.
<ey[m]>
so it gets harder to find out what paren closes what function
<beach>
ey[m]: Common Lisp programmers don't see the parentheses. The parentheses are editor commands, and instead Common Lisp programmers understand the code from indentation.
<beach>
ey[m]: It is a common misconception among people to whom Common Lisp is unfamiliar, that parentheses are an important aspect of understanding the code.
<beach>
ey[m]: Anyway, what is the purpose of your question?
<beach>
Do you want us to agree with you?
<beach>
Or, are you trying to teach us something?
<moon-child>
ey[m]: as with any language, it may not be easy to understand until you're practiced in it. Japanese is also hard to read, unless you know japanese. And if you already know italian, you'll find it easier to learn spanish than japanese
<beach>
Furthermore, many nested expressions suggest that the code should be broken up into smaller units.
<ey[m]>
I was just thinking of all the reasons why people don't like lisp (I love it) and this came to mind while seeing an old python conf video
<moon-child>
(though that may not be the best example since there are definite improvements to alphabetic writing systesm systems over syllabaries and logographies)
<beach>
ey[m]: People like what they are familiar with, and since Lisp is not often taught in teaching programs, it is unfamiliar, and thus, people don't like it.
zaquest has joined #lisp
karlosz has quit [Quit: karlosz]
kaftejiman has quit [Remote host closed the connection]
<edgar-rft>
What do I think of those who say that lisp is hard to read ? I do think that there is also no language that is soft to read. Stupid statements need stupid answers.
andreyorst_ has joined #lisp
zacts_ has joined #lisp
zacts_ has quit [Client Quit]
zacts_ has joined #lisp
zacts is now known as Guest97853
zacts_ has quit [Client Quit]
abhixec has quit [Quit: leaving]
zacts_ has joined #lisp
zacts_ is now known as zacts
<beach>
edgar-rft: I am sure ey[m] had a purpose with the question. But we still don't know what it is.
<beach>
Maybe we should come up with arguments against the statement to be used on those other people who think Lisp is hard to read?
<ey[m]>
beach: I was watching an old python conf video and the presenter said he left lisp for python because he felt python's syntax was much clearer.
<beach>
Ah, one of those.
<ludston>
I think, to be fair "var x = 10;" is more intuitive than (let ((x 10)...)
<beach>
In the past, I have seen or read about other people who decide to change from Lisp to something else, and they almost always give some excuse that suggests that there is something wrong with Lisp.
<beach>
Often they accuse the "community" of not doing anything about these perceived problems. But in fact, it is just a personal preference that made them change, and they are trying to protect themselves from criticism concerning their decision.
<beach>
ludston: There is nothing "intuitive" about programming. It is all learned.
<ludston>
It's more intuitive, given than most of us grow up rote-learning euclidean geometry, so it uses more of our pre-learned framework
<beach>
Yes, that's what I meant.
<beach>
It has to do with previous experience.
<ludston>
I don't think that it is harder to read lisp code than any other language though
<beach>
And, the fact that Lisp is not often taught in CS or SE teaching programs then reinforces the familiarity with this notation.
<pranavats>
That could depend on your background. For someone used to mathematical syntax that equals sign could be confusing.
<ludston>
pranavates: Interesting that you mentioned that, because I saw the results of a test for first-time programmers and that did indeed happen
macdavid313 has joined #lisp
<plisp>
euclidean geometry is beautiful. I think you meant cartesian coordinates
<beach>
So, anyway, I don't think there is anything that can be done about the people who claim that Lisp is hard to read.
<pranavats>
I have heard more convincing claims about comprehension being affected by the syntax, after one has gotten familar with the syntax. Though that is about APL, and tendency of APL programmers to rely on recognizable idioms, instead of just creating new layers of abstraction.
<plisp>
more relevant to the topic: the couple programmers I talked to were fairly quick to accept indentation-based reading. Almost as quickly as they brought up parentheses
<plisp>
python programmers*
<pranavats>
I mean comprehension of programs, not the language. Following from that, embedded DSLs can make the job of reading a program a bit of a task; needing to jump from one layer of abstraction to the other frequently, depending on the way the program is written, of course.
kini has quit [Remote host closed the connection]
macdavid313 has quit [Ping timeout: 246 seconds]
kini has joined #lisp
<ludston>
Personally, I think that the worst thing we lisp programmers do is teaching car and cdr before make-array
<python476>
lisp syntax appeal to me because most of it is closed
<python476>
like fp, you can unplug a sexp and understand it 90% of the time
<python476>
in imperative programming good luck
<python476>
(assuming you write lexical, non setq/effect heavy lisp of course)
<python476>
ludston: you think iterative array processing appeals better to newcomers ?
red-dot has quit [Quit: Going offline, see ya! (www.adiirc.com)]
<ludston>
The power of lisp over other languages, in my opinion, is that you can manipulate cons cells to generate code dynamically
<ludston>
Usually via macro-writing: But this macro-writing is an advanced skill
aartaka_d has quit [Read error: Connection reset by peer]
Nikotiini has quit [Ping timeout: 260 seconds]
aartaka has joined #lisp
<ludston>
And singly linked lists are a terrible data structure for beginner programmers, because writing algorithms to manipulate singly-linked lists can be very fiddly
<python476>
code as first class and similarly tree processing thinking first
<ludston>
Because of this, I think it is better to gain fluency using lisp data-structures like array, and hashtable, because, if you want to write fast lisp code, you will be using these data-structures most of the time
<python476>
maybe i'm too much into the linguistic side of lisps and not perf
<python476>
I always feel that perf is better added onto a good overall design and problem space mapping
<ludston>
And then, mastering list manipulation later, for the sake of writing macro's, is a good approach
<python476>
which fits the dsl approach
Guest97853 has quit [Quit: leaving]
zacts_ has joined #lisp
zacts is now known as Guest41845
zacts_ is now known as zacts
<ludston>
I think that teaching '(), car and cdr first encourages programmers to first try and model their problems in the singly-linked list space, but singly-linked lists are very often a poor abstraction for many algorithms
<python476>
can't say
<python476>
it made inductive reasoning easier to learn
<pranavats>
What do you mean by a poor abstraction ludston?
<python476>
array/indices would confuse the hell out me with induction
<ludston>
pranavats: For example, try writing the quick-sort algorithm using singly-linked lists
Nikotiini has joined #lisp
<python476>
it's obvious for in-place array processing like this
<python476>
but so much of programming is not about this kind of problems
<python476>
it's a bit like clojure
<python476>
and threading macros
<python476>
it makes a medium to long convoluted piece of code
<python476>
into a nice little sequence of function (-> a b c d e f)
<python476>
then if function c needs to be effectful-over-array then be it
<python476>
but it's very important to make new devs see how the language can impact your coding
Guest41845 has quit [Quit: leaving]
<pranavats>
ludston: I see what you mean. I tried writing that when I was learning Lisp. ;)
red-dot has joined #lisp
<ludston>
pranavats: If somone was looking over your shoulder, like, "No don't do it like that, just use make-array" you'd have had a much better time, see?
<ludston>
My experience with common lisp, was that I learned it in my first year of university, because someone else said it was cool. The first book I picked up was Land of Lisp, which taught me a pile of bad habits that I had to unlearn, and then it was not until after I'd done some datastructures and algorithms courses and coming back to lisp was like, "Wow this language is so much better than C#"
<beach>
What is so hard about quicksort on a list?
<python476>
the cpu cost ?:p
<beach>
It is not particularly costly.
<python476>
ludston: what was so bad in land of lisp ? (I only skimmed bits of it)
<ludston>
beach: 'nth is O(n), and you quickly get lost in the complexity of using car/cdr
<beach>
You choose the first element as a pivot. Then partition the rest of the list according to that pivot. Recursively sort the partitions. Append the results. Done.
<beach>
It is still O(n log n).
<beach>
... on the average, I mean.
<beach>
As it is on an array.
slyrus has joined #lisp
<ludston>
beach: You're going to have O(n) malloc that way I think
<beach>
You are not allocating anything.
<python476>
you're recreating intermediate lists isn't it ?
<beach>
I should have said NCONC the results.
<beach>
Why would you do that?
<python476>
I assumed
<beach>
That would be a silly thing to do.
<python476>
at that point I don't see the value of using a list
<beach>
You have N CONS cells. All you need to do is reorganize them.
<python476>
alright
andreyorst_ has quit [Remote host closed the connection]
<beach>
python476: I wasn't arguing about the value of using a list. I was reacting to ludston thinking it was hard to implement.
<beach>
python476: By the way, a lot of Common Lisp code is imperative.
<ludston>
beach: Unfortunately, choosing the left-most cell as the partition gets the worst possible performance on an already sorted list
<python476>
yeah I'm from a recent times where immutable ds / lists influenced me more than CL ways
<beach>
ludston: Picking the middle one wont change much.
gutter` has quit [Remote host closed the connection]
judson_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<beach>
ludston: I was merely reacting to your claim that it is hard to implement. It isn't.
<ludston>
beach: It is, in the very least, less trivial to implement quicksort over a list vs over an array
lowryder has joined #lisp
<python476>
nconc seems to be a rarely used function isn't it ?
<python476>
(not arguing btw)
ralt has joined #lisp
<beach>
ludston: I strongly disagree. For an array, it gets tricky to avoid an infinite recursion.
<ludston>
Which is irrelevant to the power of lisp, which supports arrays just as easily as lists, but relevant to which to teach first
<beach>
You have to be very careful with excluding the pivot and putting it back in the right place.
<beach>
There are plenty of incorrect implementations of quicksort.
judson_ has joined #lisp
<pranavats>
Btw, I didn't use any imperative code when I tried implementing quick sort in Lisp.
<pranavats>
The version in ANSI Common Lisp by Paul Graham is just fine, which is imperative.
orivej has quit [Ping timeout: 246 seconds]
<ludston>
pranavats: And overating over a vector
<ludston>
*operating
<pranavats>
Oh. I'd like to have checked that. Thanks.
<ludston>
pranavats: You also cannot write a functional algorithm that doesn't have O(n) allocation, by definition, given that you aren't allowed to modify the source list
judson_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mrcom has joined #lisp
gutter has joined #lisp
skapate has quit [Ping timeout: 246 seconds]
zacts has quit [Quit: leaving]
<pyc>
Is there a difference between write-string and write-line?
skapata has joined #lisp
<pyc>
Ah! I see one does not add a newline and the other one does while printing the string but they both seem to return the same string.
<ludston>
pyc: One does newline
Aurora_v_kosmose has quit [Quit: Пока, мир.]
<ludston>
pyc: Easy to test the difference with (let ((s (make-new-output-stream))) (write-string "blah" s) (get-output-stream-string s))
aartaka_d has joined #lisp
aeth has quit [Ping timeout: 256 seconds]
aartaka has quit [Ping timeout: 272 seconds]
aeth has joined #lisp
Aurora_v_kosmose has joined #lisp
gutter` has joined #lisp
SN_ has joined #lisp
tomaw has quit [Quit: Quitting]
red-dot has quit [Ping timeout: 256 seconds]
Nikotiini has quit [Ping timeout: 256 seconds]
Walex has quit [Ping timeout: 256 seconds]
SN_ is now known as red-dot
slyrus1 has joined #lisp
tomaw has joined #lisp
Nikotiini has joined #lisp
gutter has quit [Ping timeout: 256 seconds]
slyrus has quit [Ping timeout: 256 seconds]
Blukunfando has quit [Ping timeout: 256 seconds]
glamas has quit [Ping timeout: 256 seconds]
glamas has joined #lisp
nmg has joined #lisp
Walex has joined #lisp
shka_ has joined #lisp
zacts has joined #lisp
_whitelogger has joined #lisp
anticrisis has joined #lisp
skapata has quit [Remote host closed the connection]
gaqwas has joined #lisp
gaqwas has joined #lisp
mrcom has quit [Read error: Connection reset by peer]
akoana has left #lisp ["Leaving"]
mrcom has joined #lisp
kini has quit [Remote host closed the connection]
gioyik has quit [Quit: WeeChat 3.0]
kini has joined #lisp
villanella has joined #lisp
sxmx has quit [Quit: WeeChat 2.9]
rgherdt has joined #lisp
hendursa1 has joined #lisp
pve has joined #lisp
hendursaga has quit [Ping timeout: 240 seconds]
aartaka has joined #lisp
aartaka_d has quit [Ping timeout: 246 seconds]
cg505 has quit [Ping timeout: 240 seconds]
cg505 has joined #lisp
ralt has quit [Quit: Connection closed for inactivity]
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
rtypo has joined #lisp
ralt has joined #lisp
VincentVega has joined #lisp
attila_lendvai_ has joined #lisp
anticrisis has quit [Read error: Connection reset by peer]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
luni has joined #lisp
cage_ has joined #lisp
rogersm has joined #lisp
gutter` has quit [Remote host closed the connection]
Blukunfando has joined #lisp
rogersm has quit []
gutter has joined #lisp
penguwin has quit [Ping timeout: 272 seconds]
ljavorsk has joined #lisp
v0|d has quit [Remote host closed the connection]
CEnnis91 has quit [Quit: Connection closed for inactivity]
penguwin has joined #lisp
VincentVega has quit [Quit: Ping timeout (120 seconds)]
beach` has joined #lisp
beach has quit [Disconnected by services]
beach` is now known as beach
ldbeth has joined #lisp
iskander- has joined #lisp
iskander has quit [Ping timeout: 240 seconds]
red-dot has quit [Quit: Going offline, see ya! (www.adiirc.com)]
Inline has joined #lisp
ak5 has joined #lisp
ak5 has quit [Client Quit]
ak5 has joined #lisp
perrier-jouet has joined #lisp
aorst has joined #lisp
andreyorst has quit [Ping timeout: 246 seconds]
zacts has quit [Quit: leaving]
trocado has joined #lisp
zacts has joined #lisp
liberliver has joined #lisp
luni has quit [Quit: Connection closed]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
Inline has quit [Quit: Leaving]
amb007 has joined #lisp
andreyorst has joined #lisp
attila_lendvai_ has quit [Ping timeout: 260 seconds]
surabax has joined #lisp
random-nick has joined #lisp
Inline has joined #lisp
trocado has quit [Ping timeout: 264 seconds]
aorst has quit [Ping timeout: 272 seconds]
Xach has quit [Changing host]
Xach has joined #lisp
tinga has quit [Ping timeout: 256 seconds]
tinga has joined #lisp
<pyc>
Is there any best practice guidelines for write-line vs. format? Is format to be avoided when write-line would suffice?
<phoe>
I never really use write-line myself
<pyc>
phoe: do you always use format?
orivej has joined #lisp
<pyc>
I see all tutorials and PCL book use format even while printing simple strings. Makes me wonder why write-line is ignored. For simple strings, the code looks neater with write-line.
<phoe>
more or less yes, unless I deal with single characters
<phoe>
for me it's (format t "...~%") or (format t "~A~%" variable-string); possibly superfluous, but I never really felt the need to use write-line
<pyc>
phoe: thanks. that is what I wanted to know. for single characters, I guess you use write-char (still not write-line), am I right?
<phoe>
yes
<phoe>
or princ
mrcom has quit [Ping timeout: 265 seconds]
<Xach>
i use write-line from time to time. i like it better than (format t "~A~%" line)
<Xach>
but it depends on context
frodef` has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
<pyc>
Xach: thanks! Incidentally, I was looking for write-line on the web and I came across your code. I agree I like (write-line line) to be cleaner than (format t "~A~%" line).
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
ldbeth has quit [Ping timeout: 256 seconds]
amb007 has quit [Read error: Connection reset by peer]
ldbeth has joined #lisp
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
orivej has quit [Ping timeout: 240 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
mankaev has quit [Ping timeout: 272 seconds]
iskander- has quit [Ping timeout: 256 seconds]
iskander has joined #lisp
andreyorst_ has joined #lisp
aartaka has quit [Read error: Connection reset by peer]
aartaka_d has joined #lisp
mankaev has joined #lisp
joshcom has joined #lisp
joshcom has left #lisp [#lisp]
mankaev has quit [Ping timeout: 256 seconds]
galex-713 has quit [Ping timeout: 272 seconds]
galex-713 has joined #lisp
orivej has joined #lisp
mrcom has joined #lisp
galex-713 has quit [Ping timeout: 272 seconds]
galex-713_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 256 seconds]
l1x has joined #lisp
kapil_ has quit [Read error: Connection reset by peer]
kapil_ has joined #lisp
Lord_of_Life has joined #lisp
kapil_ has quit [Client Quit]
kapil_ has joined #lisp
jeosol has quit [Quit: Ping timeout (120 seconds)]
<ralt>
_death: are you still maintaining dbus? I've been playing with it again this week, and the main issue I have with it is the error reporting. For example, an invalid list of parameters returns an EOF error
<ralt>
It works great beside the errors that are typically pebkac
<ralt>
Been thinking about making a more lispy interface on top of it
<ralt>
Like generating classes based on introspection
<ralt>
I wonder if that's possible
<ralt>
Because the introspection is runtime but the classes and their slots are defined at compile time :/
<ralt>
Maybe with closer-mop I can generate dynamic slots and stuff?
<ralt>
That lib would obviously be called closer-dbus ^^
ludston has quit [Ping timeout: 272 seconds]
luna_is_here has quit [Ping timeout: 272 seconds]
galex-713_ has quit [Ping timeout: 246 seconds]
luna_is_here has joined #lisp
galex-713 has joined #lisp
red-dot has joined #lisp
hhdave_ has joined #lisp
galex-713 has quit [Ping timeout: 256 seconds]
ljavorsk has quit [Ping timeout: 256 seconds]
hhdave has quit [Ping timeout: 260 seconds]
hhdave_ is now known as hhdave
galex-713 has joined #lisp
galex-713 has quit [Ping timeout: 256 seconds]
ldbeth has quit [Ping timeout: 260 seconds]
galex-713 has joined #lisp
ldbeth has joined #lisp
galex-713 has quit [Ping timeout: 256 seconds]
galex-713_ has joined #lisp
mindCrime has joined #lisp
ldbeth has quit [Remote host closed the connection]
ldbeth has joined #lisp
galex-713_ has quit [Ping timeout: 246 seconds]
galex-713 has joined #lisp
lucasb has joined #lisp
edgar-rft has quit [Quit: Leaving]
aindilis` has joined #lisp
kaftejiman has joined #lisp
aindilis has quit [Ping timeout: 240 seconds]
liberliver has quit [Quit: liberliver]
iskander- has joined #lisp
zacts has quit [Quit: leaving]
perrier-jouet has quit [Quit: WeeChat 3.0]
villanella has quit [Ping timeout: 260 seconds]
iskander has quit [Ping timeout: 256 seconds]
amb007 has quit [Ping timeout: 256 seconds]
amb007 has joined #lisp
red-dot has quit [Quit: Going offline, see ya! (www.adiirc.com)]
hiroaki has joined #lisp
mankaev has joined #lisp
waleee-cl has joined #lisp
<_death>
ralt: sure, I can review and accept patches.. not using it nowadays so there are no changes coming from me
<ralt>
_death: fair enough
thmprover has joined #lisp
mmmattyx has joined #lisp
<_death>
ralt: I guess one way to make a lispy interface would be to write something that generates stub code from an interface and dump it to a file.. then your code could depend on that stub (harnessing asdf) and the names it exports
Alfr has joined #lisp
ljavorsk has joined #lisp
Inline has quit [Ping timeout: 246 seconds]
hineios has quit [Ping timeout: 256 seconds]
rgherdt_ has joined #lisp
iskander has joined #lisp
hhdave_ has joined #lisp
ldbeth` has joined #lisp
ptr_0x0001 has joined #lisp
mood_ has joined #lisp
mood has quit [Ping timeout: 256 seconds]
null_ptr has quit [Ping timeout: 256 seconds]
hhdave has quit [Ping timeout: 256 seconds]
nckx has quit [Ping timeout: 256 seconds]
hhdave_ is now known as hhdave
iskander- has quit [Ping timeout: 256 seconds]
shka_ has quit [Read error: Connection reset by peer]
judson_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
heisig has joined #lisp
Dizidentu has joined #lisp
ldbeth` has quit [Ping timeout: 265 seconds]
matryoshka has joined #lisp
matryoshka has quit [Client Quit]
ldbeth` has joined #lisp
cage_ has quit [Ping timeout: 260 seconds]
davd33 has joined #lisp
luna_is_here has quit [Quit: luna_is_here]
tlaxkit has joined #lisp
luna_is_here has joined #lisp
ldbeth` has quit [Ping timeout: 246 seconds]
mindCrime has quit [Ping timeout: 264 seconds]
luna_is_here has quit [Client Quit]
ldbeth` has joined #lisp
luna_is_here has joined #lisp
matryoshka has joined #lisp
ldbeth` has quit [Ping timeout: 260 seconds]
perrier-jouet has quit [Quit: WeeChat 3.0]
ldbeth` has joined #lisp
ldbeth` has quit [Ping timeout: 256 seconds]
Jeanne-Kamikaze has joined #lisp
cage_ has joined #lisp
luni has joined #lisp
aindilis` has quit [Remote host closed the connection]
ldbeth` has joined #lisp
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
ldbeth` has quit [Ping timeout: 240 seconds]
yitzi has quit [Remote host closed the connection]
yitzi has joined #lisp
luna_is_here has quit [Quit: luna_is_here]
ldbeth` has joined #lisp
luna_is_here has joined #lisp
rogersm has joined #lisp
<rlp10>
How do you append a subdirectory to the end of a pathname? I'm finding the number of different libraries a bit confusing, since what I want to do is pretty common I guess.
<rlp10>
phoe: Thank you, that's really helpful. I guess it's the other way round from what I was expecting, but that makes no odds. I don't know why I was struggling to find it so much. Anyway, I appreciate your quick response - thanks.
<phoe>
no problem
ldbeth` has quit [Ping timeout: 256 seconds]
<phoe>
pathnames in CL tend to be confusing, so no worries
<rlp10>
phoe: Yeah, tell me about it!
<aeth>
phoe: shouldn't it be uiop:merge-pathnames* to fix portability issues between implementations?
<aeth>
cl-fad also is a thing.
<rlp10>
aeth: So is that what I should be using? Quite a bit of my scripting deals with folders, files, their contents etc.
<aeth>
rlp10: uiop/filesystem and uiop/pathname and uiop/configuration (and maybe a few other parts of uiop) may be able to help with some of your problems, but I'm not very familiar with the nuances because I rarely work with complicated file-based operations. Iirc, ASDF mostly uses UIOP for this.
<phoe>
aeth: kinda should, yeah
gioyik has joined #lisp
ldbeth` has joined #lisp
<aeth>
rlp10: e.g. (uiop:xdg-config-home) should get you the correct parent directory of where you should put your configurations.
<aeth>
Well, on Linux (XDG) and on Windows (whatever Windows uses). It treats macOS like a Unix, rather than using macOS's custom conventions, so it might not be fully idiomatic there depending on what you're doing.
<rlp10>
OK, I have to confess that I'm new, so I don't fully understand what uiop and asdf are. I'd probably better start by reading their websites.
<rlp10>
I'm on Linux, so that element doesn't bother me.
CEnnis91 has joined #lisp
<aeth>
rlp10: Packages in CL are namespaces for symbols. Quicklisp is the "package" manager, but since the name "package" was taken, it's really the "system" manager. Systems are ASDF systems, and they basically are the standard library format in CL. ASDF fills a similar role to e.g. make. ASDF uses UIOP as its utility library, which means UIOP can be useful if you're dealing with files.
<aeth>
s/the standard library format/the library format that's standard/
<aeth>
(since "standard library" means something else)
<aeth>
De facto standard, though, not in the spec.
<rlp10>
aeth: Thanks for your explanation, that helps.
<rlp10>
So all other things being equal, I should be trying to use UIOP for compatibility?
<aeth>
UIOP or CL-FAD should give you what you need, but since most people already have UIOP installed (because it's used by ASDF), the latter is probably more popular.
ldbeth` has quit [Ping timeout: 246 seconds]
<rlp10>
OK, got it, thanks
xanderle has quit [Ping timeout: 246 seconds]
<aeth>
UIOP does a *ton* of extra stuff, but it's mostly used for its file/path/etc. functionality.
rogersm has quit [Remote host closed the connection]
aindilis has joined #lisp
ldbeth` has joined #lisp
lilgopher has joined #lisp
luna_is_here has quit [Quit: luna_is_here]
rolaids_guy is now known as greeb
greeb has joined #lisp
greeb has quit [Changing host]
luna_is_here has joined #lisp
ldbeth` has quit [Ping timeout: 240 seconds]
<aeth>
It's usually polite to stay within subdirectories of uiop:xdg-config-home or uiop:xdg-cache-home or uiop:xdg-data-home if reading/writing. If only reading, then asdf:system-source-directory will get you the directory of a system (i.e. library). I guess you start from cl:user-homedir-pathname if you want to read/write e.g. ~/Documents
mrcom has quit [Read error: Connection reset by peer]
lilgopher has left #lisp [#lisp]
mrcom has joined #lisp
ldbeth` has joined #lisp
rogersm has joined #lisp
ldbeth` has quit [Ping timeout: 256 seconds]
rogersm has quit [Client Quit]
<ralt>
Those xdg- functions also helpfully accept a path as an argument
luna_is_here has quit [Quit: luna_is_here]
attila_lendvai_ has joined #lisp
mood_ has quit [Quit: Gone.]
hnOsmium0001 has joined #lisp
<aeth>
ralt: yes, and then you can write something like this: (apply #'path-from-dir (funcall lookup-function) (append (if org-name (list org-name)) (list app-name)))
mood has joined #lisp
luna_is_here has joined #lisp
<aeth>
ralt: that should get you "professional" looking usage of ~/.local/share/ (or whatever the #'xdg-data-home happens to be configured as) where it's ~/.local/share/your-organization/your-app/ or ~/.local/share/your-app/
<aeth>
That already gets you more polish than a lot of programs (paid or free) tend to do.
luna_is_here has quit [Client Quit]
<aeth>
(In that case, #'path-from-dir is in turn just a trivial wrapper over uiop:merge-pathnames*)
mood has quit [Quit: Gone.]
luna_is_here has joined #lisp
mood has joined #lisp
perrier-jouet has joined #lisp
<ralt>
aeth: the xdg- functions accept several parameters
skapata has joined #lisp
luna_is_here has quit [Quit: luna_is_here]
<ralt>
So whatever (apply #'xdg-data-home (list ...)) or something
aartaka_d has quit [Ping timeout: 256 seconds]
luna_is_here has joined #lisp
aartaka has joined #lisp
luna_is_here has quit [Client Quit]
<aeth>
ralt: doing (uiop:xdg-data-home #P"foo" #P"bar") I get ~/.local/share/bar rather than ~/.local/share/foo/bar
<ralt>
aeth: try #p"foo/"
<aeth>
ralt: then it needs to be wrapped, anyway, so you get #P"foo/" #P"bar/"
luna_is_here has joined #lisp
<aeth>
out of "foo" and "bar"
<aeth>
ralt: You also need to reverse the order, since the optional part (the parent directory) comes first.
<ralt>
I mean, that's the API provided to you
<aeth>
What I mean is, you want to input "bar" "foo" or "bar" NIL and get #P"foo/" #P"bar/" or #P"bar/"
luna_is_here has quit [Client Quit]
<ralt>
#p"foo" is a pathname that represents a file, so when you try to use it and don't get it as part of a folder... that's expected