freenode/#lisp - IRC Chatlog
Search
2:09:17
madpengu
(defparameter *a* (list 1 2 3)) (defparameter *b* (list 4 5 6)) (defparameter *c* (append *a* *b*)) (setf (first *a*) 55)
2:15:22
madpengu
Okay, figured, append is only allowed to reuse the last structure, not just any one of them
2:20:08
pjb
madpengu: append is not destructive, but the result shares the last argument, so if you mutate the result, it could be destructive!
2:20:56
pjb
(let ((a (list 1 2 3)) (b (list 4 5 6)) (c (list 7 8 9))) (tailp c (append a b c))) #| --> t |#
2:21:00
madpengu
I was just confusing about what is reused, it seems only the last structure, no the first one.
2:21:52
pjb
Notice that this is what lets you use append to build a dotted list: (append '(1 2 3) 4) #| --> (1 2 3 . 4) |#
2:23:15
dmiles
(otherwise indeed it may have been nice to have had it resue the first structure to save space)
2:23:44
pjb
(let ((a (list 1 2 3)) (b (list 4 5 6)) (c (list 7 8 9))) (tailp a (nconc a b c))) #| --> t |#
2:29:00
pjb
madpengu: you can also use (com.informatimago.common-lisp.picture.cons-to-ascii:draw-list (cons '(1 2 3) 4))
3:57:59
drmeister
I realize that nil is not a character - but I have some code (not my own) that is invoking unread with nil.
4:09:27
jasom
ebrasca: every object in lisp is either a cons or an atom. The type atom is literally the same as the type (not atom)
4:10:30
jasom
ebrasca: it's a bit silly that vectors and hash-tables are atoms, but the atom/cons distinction predates lisps having those
4:41:27
jmercouris
anyone know a cl lib that provides functionality similar to: https://www.passwordstore.org or perhaps a wrapper for it?
4:50:51
madpengu
jmercouris: That is a stupid simple wrapper around gpg. You could probably write in cl in 2 lines of code ;)
5:14:02
jmercouris
I'm hesitant to recreate it in CL because I think there are some users of pass already, and I'd like to integrate with their workflow rather than break it
5:43:56
madpengu
jmercouris: I use pass all day erry day. And considering that it is just a bash script, I am not sure how you can find a cl library.
5:48:48
beach
jmercouris: I consider it progress whenever some existing software can be rewritten in pure Common Lisp, or at least as pure as possible, depending on the task at hand. It makes the software safer and easier to maintain for us.
5:51:50
jmercouris
Ironclad also looks like a nice library: https://github.com/sharplispers/ironclad
5:59:41
beach
jmercouris: There have been some issues with Ironclad. I suggest you ask Bike and drmeister.
6:27:18
beach
I have almost all the customization code in place. I think only what backquote returns need to be customized.
6:28:39
beach
Extracting it would be the good opportunity to make sure it is truly implementation independent, and also the opportunity to document it properly.
7:32:03
beach
The fact that Common Lisp has several implementations can be confusing to "modern" programmers who are used to single-implementation languages, where the language and the implementation evolve together.
7:32:09
beach
But having a fixed standard like Common Lisp does, and having several possible implementations of that standard to choose from is actually a good thing.
7:32:10
beach
A commercial software project that chooses a single-implementation language is actually taking a great risk.
7:36:57
dmiles
zhoujingrui: paste an entire function to pastebin, RET is used in a certain dialect of lisp that i am very familiar with
7:38:09
dmiles
hah i see now, i thought the refernce to the keyboard was a joke.. but now i see this is instructions
8:04:21
beach
ebrasca: I am fine thank you. I am working on one the ELS submissions for this year. What about yourself?
8:09:49
beach
Quite nice. There are usually almost 100 participants, and many of the same people come back every year, so it is good to see them again, and discuss what they are doing. Many people here on #lisp are regular participants.
8:10:57
hajovonta
today morning I have this error message when starting SLIME: fatal error encountered in SBCL pid XXXX: can't find core file at ~/sbcl/lib/sbcl/sbcl.core
8:11:18
beach
ebrasca: The thing to know about academic conferences is that the presentations are nice, but secondary. The primary interest is to meet the other participants and discuss with them face to face.
8:14:46
hajovonta
it was more than a year when I installed sbcl, but as I remember, I couldn't write to that directory
8:16:19
beach
OK, very preliminary version of one of the submissions: http://metamodular.com/partial-inlining.pdf
8:17:21
hajovonta
beach: I had discussed it briefly with my wife last week, and it seems she's excited to go there for a few days.
8:17:23
beach
ebrasca: Take a flight to Malaga, then a bus to Marbella. Use AirBnB to get a place to stay.
8:18:39
|3b|
hajovonta: have you reinstalled sbcl since then, or made any major changes to OS install?
8:21:24
hajovonta
|3b|: I don't think so. but the problem is only present when I start via M-x slime. If I open a terminal then I can start SBCL. I have a script that I use to set up an load certain lisp files into the image at start (with sbcl --load) and then load SLIME's swank-loader and connect to it in a separate step
8:23:05
beach
ebrasca: The fee is very small, so your cost is going to be dominated by transportation.
8:23:36
ebrasca
beach: https://www.google.com/flights/#search;f=OSR;t=AGP,YJM;d=2018-01-28;r=2018-02-01
8:30:32
|3b|
hajovonta: and if you specify a path to sbcl in .emacs, try specifying that path in shell
8:33:53
|3b|
yeah, that might give you different environment variables depending on where you set them, so make sure you are running same sbcl in both
8:36:30
|3b|
and if you get a version # in the error message from starting it in emacs, compare that to what you get from shell
8:37:34
hajovonta
maybe quicklisp gets in the way? I have that two lines that ql:add-to-init-file generated
8:39:01
hajovonta
(progn (load "/home/_/quicklisp/dists/quicklisp/software/slime-v2.19/swank-loader.lisp" :verbose t) (funcall (read-from-string "swank-loader:init")) (funcall (read-from-string "swank:start-server") "/tmp/slime.8992"))
8:46:18
hajovonta
~/sbcl/bin/sbcl: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), for GNU/Linux 2.6.18, dynamically linked (uses shared libs), not stripped
8:47:42
phoe
hajovonta: try replacing ~ with an expanded path to your homedir, in the inferior-lisp-program elisp variable.
8:56:59
hajovonta
my brother who once worked in tech support, said that 40% of the problems was due to some power failure (not plugged in, not switched on, etc)
8:57:36
|3b|
and probably 40% of the rest were not plugged in but the person just didn't tell them after figuring that out :)
9:28:40
beach
Slightly updated version of one ELS submission here: http://metamodular.com/partial-inlining.pdf
9:30:19
otwieracz
How to perform $ curl -F data=@my-file -X POST http://localhost:8080/restore with drakma?
9:31:09
otwieracz
I believed something like: `(drakma:http-request (build-url "restore") :method :post :parameters `(("data" . ,(pathname file))))`, but it keeps running indefinitely with numerous weird TCP Window Something messags in wireshark.
9:49:11
|3b|
otwieracz: maybe :parameters `(("data" . (,(pathname file) :content-type ".../..." :filename "..."))) ?
9:50:09
scymtym
beach: in the first paragraph of section 3, inlining of globally defined functions is discussed. i have two suggestions: 1) state explicitly (if it actually is the case) that the remainder of the paper will not be concerned with this kind of inlining 2) if possible, avoid "we simply incorporate the abstract syntax tree of F" since that sounds like the descriptions in other sources cited and criticized earlier
9:53:42
scymtym
beach: i have no idea either. that's why i didn't try to suggest an alternate formulation
9:55:02
flip214
minion: memo for sjl: thanks a lot for the vlime update.... (but) I'm currently looking at spacemacs.... let's see.
10:00:26
beach
scymtym: I added a phrase that I hope clarifies the purpose of incorporating the AST.
10:16:24
|3b|
beach: in 3rd bullet list in 3.2 "...about ownership lexical variables.", missing "of"?
10:22:42
beach
I am asking because other people here also use "what" instead of "which" or "that", so I am wondering what languages might do that.
10:24:52
otwieracz
beach: Polish, unfortunately. Sorry, my native language, forigve me for this advertisement. :)
10:26:38
tazjin
I'd love to learn Russian, but it's very difficult to learn a language like that without living in the country
10:47:19
|3b|
beach: could be a bit more clear about how the 4 steps in 3.2 correspond to worklist items, in particular "the mapping" and similar in step 4 are for each of 2 output worklist items
10:51:31
pjb
tazjin: use youtube for you linguistic bath: https://www.youtube.com/channel/UCuSx-lf2ft7hPceGVNHybOw https://www.youtube.com/user/starmedia https://www.youtube.com/watch?v=K59KKnIbIaM https://www.youtube.com/channel/UC2D0dmLHKbIe9aACnlcTLPg
10:52:36
tazjin
pjb: language learning is an interactive process for me, but maybe I could find myself a community of Russian expats ;-)
11:11:50
beach
It used to be current practice to "publish" both in SIGPLAN notices (no peer review) and in a conference (with peer review).
11:13:38
beach
It's OK to include both references in case of SIGPLAN+conference. They may be slightly different, and one could be easier to get hold of.
11:16:19
Lithp
Good day Lispers.. So is it possible to have an object (B) be the slot-value of another object (A) and then modify the print-slot-value of (A) to print the values of (B) under the (A) slot when calling print-object on (A)?
11:16:50
Lithp
Maybe the meta-question is should i be putting object instances in another instances slots?
11:17:17
p_l
Lithp: there's nothing saying you shouldn't. They are just objects, like any other value
11:18:18
|3b|
ACTION isn't sure what you are asking though. do you want to modify the printing of As to show B? or somehow cause the printing to change due to containing a B without explicitly modifying the printing of As?
11:19:55
phoe
this is pretty commonly done, actually, when you want to print-unreadable-object with some details about this object
11:21:04
Lithp
Thats where my problem is arising.. print-unreadable to afile needs to be able to print the nested object
11:22:57
|3b|
just print the contents of the slot, and the print-object method for whatever is there will be used :)
11:28:28
|3b|
ebzzry: what are you trying to load? the message seems to be saying that whatever it is you are loading has a bad .asd :)
12:17:19
solene
hello, I'm stuck at something that seems simple.. I'm trying to loop over a list of values and call a macro with each value, like this example : https://zerobin.net/?ed147d5ef76b1dda#sFl8qUYx6UOztDsm6871VWCEa5pp1jFdWe8+tzkcEvc=
12:22:30
|3b|
solene: macros are expanded before it starts evaluating the loop (for example during compilation), so it can't see the value of variables inside the loop when it is expanded
12:24:51
|3b|
possibly you wanted ,(getf parameters :name) in the macro, but then it would break if you stored the parameters in a variable
12:25:46
|3b|
or maybe you just wanted a function with keyword arguments, (defun hello (&key name) (format t "hello ~a~%" name)) (loop for name in '(...) do (hello :name name))
12:26:47
solene
this example is a reduced version of a macro I use in a piece of code I wrote. It's hard to explain... but it's a "config file" for non lisp people. I found it easier to write (f name1 test-this (:param1 "hello")) instead of (f 'name1 'test-this '(list :param1 "hello")))
12:29:54
p_l
what's the current status on web frameworks? Something more complete than bare-bones HTTP handling + templates, for example seaside style?
12:31:28
pjb
so: (loop for name in '("martin" "sheley") collect (funcall (macro-function 'hello) `(hello (:name ,name)) nil)))
12:31:31
|3b|
solene: well, that example has all quoted values and no variables, which would work with your macro
12:32:48
|3b|
if you want a more complicated not-quite-lisp DSL that interacts with lisp variables, you may need to do more work in your code/macros
12:33:48
|3b|
possibly you want a functional API you can call from code that is used by the "non-lisp-user" macro
12:33:51
pjb
solene: (loop for partition in '("/" "/home/" "/var/") collect (funcall (macro-function '=>) `(=> mail disk-usage (:path ,partition :limit 90)) nil))
12:34:56
pjb
solene: when you call a function, you pass the parameters in number, type and order that are required by the function. It's the same with a macro function.
12:35:08
solene
i see, sadly it get too much complicated for non lisper. I may write a wrapper for passing a list maybe
12:37:12
|3b|
consider for example distinguishing (=> mail disk-usage (call-some-function)) from what you have, like if you wanted to look up the mount-point and usage from a DB
12:38:18
|3b|
at some point you end up adding back in the ' to distinguish which things should be evaluated or not, and are back to just having a function
12:39:25
|3b|
there is also the option of writing a macro that expands to a bunch of (=> ...) forms, if the cases where you want variables are limited enough
12:39:57
|3b|
though possibly still had to do cleanly without parsing the forms manually, for same reasons
12:40:24
pjb
solene: well no! |3b| listed the correct options: - modify your macro to evaluate arguments at run-time, or - write a macro to expand to multiple macro calls!
12:42:31
pjb
What funcall macro-function demonstrate is that a macro generates CODE. Therefore there's almost always no point in calling it at run-time.
12:43:17
pjb
Again, no point in skipping quoting. As you've seen, you want to pass the result of expressions and variables!
12:48:14
solene
I see, using a function instead of a macro would just requires using (=> 'mail 'disk-usage ) and everying would works
12:50:15
pjb
or also extend your language: (defconstant mail 'mail) (defconstant disk-usage 'disk-usage) then: (=> mail disk-usage)
13:44:17
solene
pjb, thank you for your help. I've been able to use a function instead of a macro, this makes everything easier, and so I've been able to use a &rest parameter. So (=> mail disk-usage (:path "/" :limit 90)) becomes (=> mail disk-usage :path "/" :limit 90)
13:51:21
solene
lieven, I aim at non lisper as this is a configuration file, I prefer avoid most of syntax is possible
13:52:40
solene
I'm working on a monitoring tool that check user defined things and use some user defined alerts when the check fails, it should be really easy to use
13:54:03
pjb
solene: if you aim non-lispers, perhaps you should write your own interpreter for your configuration files. As it is, I assume you use LOAD, and any lisp is available. This will be confusing to naive users when they'll enter the debugger for incorrect lisp code.
13:59:41
solene
pjb, I want that the config file allow to use code in it, and the config is really easy. It's a personal project that I share to people so it should be improved with time or if people contribute