freenode/lisp - IRC Chatlog
Search
13:12:01
rk[ghost]
i have been tempted to make ca*d*r functions for longer than the default ones supports :P
13:13:15
dlowe
I like beach's solution, except it traverses n multiple times. Maybe just (defun substitute-index (index list val) (loop for e in list as i from 0 collect (if (= i index) value e)))
13:22:54
mrottenkolber
could anyone on Windows/Darwin test this and reply to the issue with the results? https://github.com/death/monotonic-clock/pull/1
13:30:32
dlowe
this was way more annoying than I thought it would be http://paste.lisp.org/display/348650
13:39:50
rk[ghost]
i thought i could use its magic without having to just rebuild my list with manually substituting at the right spot.
13:41:43
rk[ghost]
i must have done it wrong, because i used a copy-list and it still updated the original list as well.
13:42:51
nowhereman_
I just encountered a problem I solved but don't understand: if I save an SBCL image, it fails at loading "sb-rotate-byte"
13:42:54
rk[ghost]
i even tried doing a (let ((list-copy (copy-list my-list))) (setf (nth ... ...) list-copy)) and it still updated the original list
13:53:10
phoe
https://github.com/eudoxia0/crane <- should I be using this with postgres? or exist there better tools?
13:59:01
phoe
crane seems to be more pleasant from the development point of view - it seems to automatically define and redefine DB schema
14:51:40
_death
some people start from application and see the database as auxiliary, hence they like ORMs and often need to migrate data.. others start from database schemas and then go to write the applications.. no need for ORM or to migrate data often
15:19:27
_death
in recent years I use SQL syntax for SQL queries.. before that I used postmodern's s-sql
15:21:31
_death
s-sql was convenient when I needed to actually build the query.. if the alternative is string interpolation or such, then of course s-sql is better
15:22:06
Grue``
the problem is the assumption that SQL has the best syntax for its domain. unlike better syntaxes like Lisp's, it's not composable
15:22:21
_death
but if the alternative is to write the query a bit differently, then maybe s-sql isn't so advantageous
15:24:37
Grue``
the basic task in a CRUD app is to have a table filtered by a bunch of filters from a HTML form. the SQL query in question would have arbitrary amount of JOINs and WHERE clauses
15:25:28
_death
Grue: there are many variables here.. for example, if you're aiming at portable SQL or (say) Pg-specific.. the RDBMSs always come up with new syntax, so it is possible that you want to use the one they use instead of playing catch-up
15:26:09
Grue``
I had to manually construct such queries a few times (due to lack of support for certain db features in the ORM) and it's not pretty
15:29:42
_death
I've not yet tried the yesql approach.. but I have something I recently started writing that I may volunteer for that experiment :)
15:42:40
Guest70553
beach It is only one file, I am learning lisp, single file with 2 global defparameter variables, I did eval on them with no errors
15:52:37
Guest70553
_death It was, after deleting ~/.slime... history files it is working again. Thank you very much, to all of you :). One kiss :*
15:53:44
_death
those who learn the wrong things from history may benefit from erasing it altogether :)
18:09:54
sukaeto
re: the whole SQL discussion - I've been using Fukamachi's SxQL and I've been pretty happy with it
21:13:16
diegs_
how is lisp (SBCL) as a scripting language? For most 'misc' tasks/scripts, I'll use bash and/or python, but I just find lisp fun and was just wondering
21:16:30
diegs_
Oh i love me some elisp, but it seems odd to use it for standalone scripts that aren't emacs related
21:25:17
ealfonso
I would like to use read-line on a usocket stream, but I only know when to stop reading to based on a timeout (ie I can't use newline or EOF). how can I achieve this?
21:32:30
JonSmith
Yeah, but I mean, you read-line on a stream that doesn't have a newline but stays open (assuming like a tcp connection or w/e), it'll block until you get a newline
21:32:31
ealfonso
I'm also getting this: "There is no applicable method for the generic function #<STANDARD-GENERIC-FUNCTION USOCKET:SOCKET-RECEIVE (1)> when called with arguments (#<USOCKET:STREAM-USOCKET {1005A8A253}> NIL 9999)". which is strange since (describe 'usocket:socket-receive) says: "SOCKET-RECEIVE names a generic function: Lambda-list: (USOCKET BUFFER LENGTH &KEY)"
21:33:48
JonSmith
but if your protocol indicates you'll always get a newline you could just readline in a loop and check the time or whatever
21:33:53
ealfonso
JonSmith yeah, so I guess I can't use read-line, and I have to do it manually, which I'm trying via usocket:socket-receive, but for some reason it's complaining with error above
21:34:43
ealfonso
JonSmith I can't check the time because read-line blocks, and I can't guarantee I will get a newline
21:35:50
ealfonso
docs say I can pass nil for buffer and nil for length, and first arg should be a socket: https://common-lisp.net/project/usocket/api-docs.shtml
21:47:47
ealfonso
JonSmith how is this different from read-line? I can't specify a timeout and read-sequence seems to block
21:49:19
JonSmith
unless you can peek the stream and see how many bytes are in it then tailor your read-sequence to that length
21:51:22
ealfonso
looking at (describe 'read-byte), doesn't say much. so it doesn't block? I don't see a way to get a usocket stream's length
21:58:32
JonSmith
in which case you'd just read in a loop until you hit a null and buffer it up yourself however you like
22:01:27
pjb
(com.informatimago.common-lisp.cesarum.list:tree-difference '(if (= a b) yes no) '(if (= a 0) yes nil)) #| --> (= (= = (/= b 0) . =) = (/= no nil) . =) |#
22:12:39
diegs_
fe[nl]ix: i've _think_ got that bit, the error is: (IOLIB/GROVEL::GROVEL-ERROR #<SIMPLE-STRING "External process exited with code ~S.~@
22:12:41
diegs_
..." (len=167) {100399019F}> 1 "g++" ("-m64" "-Wno-write-strings" "-I/home/diego/quicklisp/dists/quicklisp/software/iolib-v0.8.2/src/grovel/" "-o" "/home/diego/.cache/common-lisp/sbcl-1.3.18.62-f6ff1ee2e-linux-x64/home/diego/quicklisp/dists/quicklisp/software/iolib-v0.8.2/src/syscalls/ffi-types-unix"
22:12:43
diegs_
"/home/diego/.cache/common-lisp/sbcl-1.3.18.62-f6ff1ee2e-linux-x64/home/diego/quicklisp/dists/quicklisp/software/iolib-v0.8.2/src/syscalls/ffi-types-unix.c") "" #<SIMPLE-STRING "In file included from /home/diego/.cache/common-li..." (len=364332) {10036A000F}>)
22:12:45
diegs_
source: (ERROR (QUOTE GROVEL-ERROR) :FORMAT-CONTROL FORMAT-CONTROL :FORMAT-ARGUMENTS FORMAT-ARGUMENTS)
22:14:42
fe[nl]ix
diegs_: try loading it with (asdf:load-system :iolib) and paste the error somewhere like paste.lisp.org
22:24:58
fe[nl]ix
is there an actual error message in the REPL ? something coming from the compiler ?
22:25:11
diegs_
fe[nl]ix: https://gist.github.com/therockmandolinist/f1c9fc363b669ce69288e73abdc87f3d
22:26:21
diegs_
fe[nl]ix: and i think i lied and am getting the same error in command line but my terminal is configured weirdly so i can't see all of it
22:27:50
fe[nl]ix
in the meanwhile, you could clone the git repository and put it into local-projects
22:28:17
fe[nl]ix
diegs_: the fix is this commit: https://github.com/sionescu/iolib/commit/c9beaf1ba0ca37ed88b312c844595ba943c19232
22:32:36
ealfonso
(describe 'ADJUST-ARRAY) => ... Adjust ARRAY's dimensions to the given DIMENSIONS and stuff.
22:33:51
Bike
implementation docstrings for standard functions are often kind of crap, since the CLHS is inevitably better
23:17:57
Bike
Well. No. It says "vector" right there. If you want to add to a list you can use push.
23:21:26
Bike
subseq doesn't work on multidimensional arrays either. and i don't know how you go from vector-push-extend to subseq, but hey, if you got whatever you're doing working
0:05:11
pjb
Well, you can use subseq on a multidimensional array if you use a displaced vector in between.
0:06:39
plll
Hi, I'm trying to get set up with any of the HTTP clients on NixOS. All of them seem to rely on libssl. Any way to get around this?