freenode/lisp - IRC Chatlog
Search
4:10:01
Ober
pillton: ok. that's what ive been doing. saw a shinmera video where he appeared to hit a swank server directly.
4:16:18
turkja
yeah i'd make swank to listen localhost only, then use SSH -L to redirect to that port
4:25:33
aeth
Rewrite it in Common Lisp. Most of the content won't be there, but that's a feature, not a bug.
5:33:37
asarch
I made this script to render the book from HTML pages into PDF with HTMLDOC: https://github.com/asarch/pcl/blob/master/doit.sh
6:01:20
beach
asarch: gigamonkey worked pretty hard to write that. I think he deserves his royalties. Perhaps you should send him some money.
6:01:24
asarch
Besides, I'm saving for "Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp", "The Elements of Artificial Intelligence" and "Introduction to Artificial Intelligence"
6:07:02
beach
I am the first to admit that publishing companies are unethical in the way they treat their authors, and in the way they make money. That is why I use self publishing when I write books.
6:08:30
asarch
I thought I could get the hard copy of the book the same way you can get books from the Free Software Foundation
6:15:46
beach
Well, I haven't checked whether what you did is legal; perhaps it is. I just think that the author deserves to be compensated for his work. The FSF does not have as a goal to make money from their publications (though they would be happy for you to order a hard copy, or course). But I pretty sure that gigamonkey did not write that book just to be a nice guy and in order to spread the word about Common Lisp.
6:15:56
asarch
If you need to change some parameters of the book, like the paper size, download the source code and compiles it
6:18:57
beach
But thanks for the information. I am now convinced that I absolutely should not make HTML versions of my books available online.
6:29:09
asarch
Even Wikipedia had a great conversion tool to get the PDF version of each article those days
6:41:29
jackdaniel
asarch: there is a huge gap between "fair share" and "free books", I think that you mistake these two terms
6:43:03
jackdaniel
I'm pretty sure RMS doesn't promote idea of free labor in contrast to fair share and the consumer rights to have control over what he bought / use
6:46:28
jackdaniel
and generally, fsf encourages to buy the manuals from them, but doesn't close the door for people, who are not interested in spending money for other people effort (wikipedia, on the other hand, encourages donations, which for some reason outrage some people)
7:01:26
beach
My solution to expensive books is to self publish and to set a reasonable price on the book. That way, more people can afford it, and I get paid significantly more per copy sold than if I had used a publishing company.
7:06:45
jackdaniel
I like the idea promoted by leanpub (namely: author sets minimum price and suggested price, user may pay any amount [min-price; inf)) and service takes 10% itself
7:07:22
jackdaniel
so royalty for the author is 90% and it is possible to publish book with minimal price 0 (of course it is only for electronic books afaik)
7:08:02
jackdaniel
study shows, that people often pay more for books which have minimal cost $0 if they find them useful
7:10:03
jackdaniel
// one last remark, there is apparently service called lulu, which allows you to print electronical books *you own* for some reasonable fee
7:14:19
beach
https://www.amazon.com/Introduction-Computer-Science-Robert-Strandh/dp/1479206660/ref=sr_1_1?ie=UTF8&qid=1513148554&sr=8-1&keywords=Robert+Strandh+introduction+to+computer+science
7:17:32
beach
https://www.amazon.com/Introduction-Computer-Science-Robert-Strandh/dp/1479206660/ref=sr_1_1?ie=UTF8&qid=1513148554&sr=8-1&keywords=Robert+Strandh+introduction+to+computer+science
7:18:03
beach
I think we should drop the subject now, and pick it up when I have Common Lisp related books to show.
7:24:29
minion
swhc: please look at pcl: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
7:24:31
minion
swhc: please see gentle: "Common Lisp: A Gentle Introduction to Symbolic Computation" is a smoother introduction to lisp programming. http://www.cs.cmu.edu/~dst/LispBook/
7:25:59
beach
jackdaniel: Since the maintainer of minion does not want to adapt it to the new format of cliki, I often give minion explicit entries so as to avoid that message.
7:27:41
jackdaniel
asarch: I think this discussion fits better #lispcafe (and I'm aware I did carry offtopic myself ;)
7:40:35
phoe
jackdaniel: depends. MINIX is also available "for free" and yet it's possible to steal it; just don't obey the terms under which it is licensed.
10:40:02
jmercouris
so, I've created this snippet of code here: https://gist.github.com/a16b5106ad918bbd843c304f09918e08
10:40:18
jmercouris
I'm curious, how might some of you write it instead? would you have used map? checked the result of the function etc?
10:40:51
jmercouris
What is the goal of the snippet? To load quicklisp if it is in either one of those directories
10:46:09
beach
I see two small problems. The first is the indentation of the DO clause of the call to LOOP. The second is the name of the function LOAD-QUICKLISP which suggest that it is always capable of loading Quicklisp.
10:47:10
beach
And you can use a quoted list rather than calling LIST, because the list is not going to be modified.
10:49:13
beach
You might consider signaling an error if the file can not be found in any of those directories.
10:50:37
beach
Like rename load-quicklisp to maybe-load-quicklisp and have it return a Boolean value indicating whether it found the file to load.
10:51:28
beach
Then you can write the loop like this (unless (loop for path in ... some (maybe-load-quicklisp ...)) (error ...))
10:53:05
pjb
(find (function maybe-load-quicklisp) '(".quicklisp/setup.lisp" "quicklisp/setup.lisp"))
10:56:30
beach
Well, if the current function is supposed to return a Boolean indicating success, it needs to be rewritten. Because as it is written now, it should only be used for side effect.
11:04:13
pjb
(defun maybe-load-quicklisp (path) (load (merge-pathnames path (user-homedir-pathname)) :if-does-not-exist nil))
11:04:49
pjb
Now there could be other errors while loading. Perhaps we want to ignore them to try the next one.
11:05:01
pjb
(defun maybe-load-quicklisp (path) (ignore-errors (load (merge-pathnames path (user-homedir-pathname)) :if-does-not-exist nil)))
11:12:38
beach
jmercouris: By the way, I like your approach to learning idiomatic code. Some people who come here couldn't care less.
11:33:24
jmercouris
beach: Thanks, I am trying to understand how a Lisper thinks and what are the strengths of the language
11:33:47
pjb
Using FIND-IF as indicated above is simplier than using MAPC. With MAPC you would have to wrap it in a BLOCK and RETURN-FROM it.
11:34:42
pjb
republican_devil: you may try Smalltalk, if you want to benefit from an integrated GUI IDE using eg. Squeak.
11:34:49
jmercouris
pjb: Ah, somehow I missed that part after your nick changed, okay, I got it, thank you!
11:36:08
pjb
republican_devil: the gentle intro is smooth anyways. You may also consider other books or tutorial, see http://cliki.net for references.
11:42:46
republican_devil
I have tried a few times and then I stop and when I come back I forgot msot
11:43:29
republican_devil
so overall programmign experience in lisp is still best once get hang of it?
11:43:31
turkja
republican_devil: for me this was the gentle introduction: http://www.gigamonkeys.com/book/
11:46:24
turkja
productivity... is of course interesting, but personally i don't program in lisp for being productive. For that i'd choose python. Lisp programming is simply fun, and it feels right and correct. Purely personal opinion, obviously.
11:47:35
jmercouris
turkja: As a "expert" python developer and "novice" lisp developer, I would say one is not necessarily more or less suited to productivity
11:47:53
jmercouris
turkja: It depends on your application, if your spec will change and you must update a lot, lisp is infinitely more flexible
11:48:08
jmercouris
if your goal is to hammer something out with a clear spec, python will oft be quicker
12:04:15
pjb
republican_devil: try to write some lisp code everyday to keep sanity after 8 hours of torture with java or whatever.
12:05:21
pjb
I find python way too limited: you only have OOP to work with python. In CL you can use any paradygm you want or need, and you can even invent new ones.
12:06:59
jmercouris
pjb: There's a lot more than just OOP, you could program in a completely functional style in python, functions are first class citizens etc
12:08:59
jmercouris
ah, well, it is annoying to do, but there are other control structures that allow you to break across new lines
12:09:49
jmercouris
way back when I was going to try to make my browser emacs style with a "lisp interpreter" and "c functions" for fast things
12:10:31
jmercouris
It's amazing what you don't know you don't know, that would have been a horrific codebase to work with
12:12:21
jmercouris
One of the best and worst decisions in python was to do code indenting with spaces and no brackets or anything
12:12:42
jmercouris
forces your code to be very neat, and break apart complexities if you see that a line is getting too long, but it is also very infuriating sometimes
12:15:40
jmercouris
pjb: beach: Thanks: https://github.com/nEXT-Browser/nEXT/commit/edda38552c38d7204ac53ab285bcd6e4bafd988d
12:18:10
turkja
For me the biggest strength of Lisp is the compiler integration with slime and friends, and the whole idea of iterative or interactive programming (sorry i can't find better term). That i simply cannot find in any other language
12:21:00
Shinmera
What pains me most about my current Android development is the lack of function reloading and the lack of a REPL to try things.
12:21:28
Shinmera
There's lots of stuff that annoys the hell out of me beside that, but that's what's costing me the most time.
12:22:24
Shinmera
I like to think that the rest of the world has been living with their legs chopped off instead.
12:25:39
jmercouris
if you were feeling particularly hard-core you might look at what is possible with NDK and make bindings
12:28:38
jmercouris
You can do a lot of stuff though with the debugger, it would be worth exploring its capabilities imo
12:30:11
jmercouris
Shinmera: This looks interesting: https://github.com/jasonwyatt/Android-DebugPort
12:53:36
Shinmera
To bring this back around to lisp, my Android work is to create a native app for my lisp chat system. https://filebox.tymoon.eu//file/TVRRM09RPT0=
13:13:06
logicmoo
trying to decide between *default-pathname-defaults* of "" or the current working dir when lisp starts up
13:14:50
Shinmera
The trick is that once you hit the filesystem relative paths automatically get turned into absolute ones by being relative to the cwd
13:15:12
Shinmera
So "" is a good choice as it avoids cluttering up pathnames that get merged with *d-p-d*
13:25:32
logicmoo
i kind of understand that clisp is following the hyperspec in that "." is not an existing file
13:25:52
logicmoo
" TRUENAME: "/home/dmiles/logicmoo_workspace/packs_usr/wam_common_lisp/t/." names a directory, not a file"
13:29:08
logicmoo
mfiano: right on, currently i am writing truename and making sure uiop has somethuing to target https://github.com/TeamSPoon/wam_common_lisp/blob/master/prolog/wam_cl/pathnames.pl
13:30:58
myrkraverk
Ok, there's something about macros in general, or with- macros in particular that I don't understand.
13:31:28
myrkraverk
(defmacro with-foo ((foo) &body body) `(invoke-with-foo (lambda (,foo) ,@body)))
13:35:33
basket
myrkraverk: Backquote is just shorthand for consing together lists, so if foo is bound to bar, then `(lambda (,foo) (fn ,foo)) is the same thing as (list 'lambda (list foo) (list 'fn foo))
13:37:53
myrkraverk
Question, do compilers (sometimes) optimize away the extra funciton calls due to lambdas?
13:39:59
logicmoo
in wam-cl i sometimes convert the lamda into a real call.. but in the case you gave there i probably wouldnt
13:59:17
phoe
I think the CL standard assumes that all pathnames create some kind of hierarchical tree-like structures.
14:12:34
pjb
myrkraverk: theorically, they could. In practice, I don't know if many CL compilers do. This is something you'd find probably more in scheme compilers.
14:13:23
pjb
myrkraverk: similarly, all the functions in CL can be open-coded (implemented as special operators). So a CL compiler is free to transform a mapcar lambda whose result is ignored into a dolist.
14:31:06
Bike
at least, it open codes mapcar so that (mapcar f ...) turns into a loop of (funcall f ...), and i think if f is a constant function it can inline that