freenode/lisp - IRC Chatlog
Search
21:28:04
Shinmera
So, I might be wrong here, but it seems possible that an implementation might (for no good reason) define a structure class that does not follow a hierarchy, and instead handle the subtype relation in the type specifier, thus making it unsuitable for generic function dispatch.
21:36:25
dim
well I'd like to target ABCL and play with JDBC sometime, but I can't produce pgloader.jar yet
21:37:15
jasom
my reading of the spec as well is that a defstruct with an :include is allowed to not be a subclass of the struct it includes
22:19:44
dim
is there a simple way to handle ncurses from CL and output unicode chars? I tried once but couldn't display e.g. ♣ and ⚑
23:14:03
axion
With drakma, if I query a URL with a 301 redirect, how would I get the url it is going to redirect to without actually connecting?
23:16:02
axion
I purposely construct a URL that redirects to a non-existent domain, and drakma will try to resolve this, even if I tell drakma not to redirect with :redirect 0, making usockets error.
23:17:12
axion
I will instead get Condition USOCKET:NS-HOST-NOT-FOUND-ERROR was signalled, because drakma attempts to resolve the 301 target
23:20:13
phoe
Is it some kind of generic function call? Perhaps you can write an AROUND method that hijacks the call if some dynamic variable is set.
23:22:41
phoe
You might actually want to make a Drakma PR that, in that place, signals a custom condition, whose slots contain the URL information.
23:24:18
axion
You can try it yourself with a url i made: (drakma:http-request "https://is.gd/ESNHyV" :redirect 0)
23:37:24
Bike
mainly i'm surprised that it signals an error instead of just returning, like it does for 404, say
23:46:11
axion
the `trivial-http` library doesn't error and shows the url in the returned header. Just very irksome i'll be using 2 http clients in this project
23:52:20
phoe
Geralt had two them swords for different use cases and you're complaining about two HTTP clients
23:52:57
axion
It's just a pain because it doesnt support keep alive, and i'll be doing many urls at once
23:59:15
phoe
well, there's your motivation to actually update drakma's HTTP-REQUEST with Yet Another Keyword Argument™
23:59:44
phoe
(drakma:http-request "http://foo.bar" :redirect 0 :return-url-on-redirect-exhaustion t)
0:04:58
axion
tbh i'd much rather see this in dexador, because lots of drakma sucks. but i have bug reports from years gone unanswered by fukamachi. I try to avoid his software for this reason, but some of it is too nice
0:05:41
marvin2
I kind of like clojure's concise way of defining a lambda: #(fun % 1) would be the same as (lambda (x) (fun x 1)). is there a way to write something similar to that (doesn't need to be exactly the same syntax)?
0:09:04
aeth
marvin2: you might be looking for alexandria's curry and rcurry (although it's not fully positional, it's just right or left) e.g. (rcurry #'fun 1)
0:09:28
aeth
And it's not a major dependency because practically any large program will have some dependency that already uses alexandria.
0:14:21
marvin2
it is different than # though, and doesn't always replace it. positional-lambda seems to be closer (virtually the same). I am tempted to write a macro λ that just expands to plambda
0:16:31
aeth
Careful about using the unicode lambda... A lot of us replace "lambda" with it through emacs configuration.
0:17:17
aeth
You'd probably want to make it #λ and use this: http://www.lispworks.com/documentation/HyperSpec/Body/f_mk_dis.htm
0:18:30
marvin2
is that some sort of convention, to start all user defined reader macros with '#' sign?
0:22:05
Bike
marvin2: not exactly a convention, it's just kind of convenient. you could use the lambda character if you want.
0:24:38
JuanDaugherty
by the time i would get around to determining the matter of fact, it prolly will
0:26:35
Bike
like, you wouldn't accept a symbol with only one character in it, or you wouldn't accept the use of only one symbol incorporating hanzi?
0:27:09
JuanDaugherty
i wouldn't accept that I freely code using hanzi, but at this point think it would have a good shot
0:40:59
Bike
something weird happened when i tried to define factorial, but it might have been that i was blindly pasting curse words
0:45:38
JuanDaugherty
yeah, that must have a non expletive meaning the radicals are too common, wiktionary says it's cantonese
0:47:03
JuanDaugherty
lil wierdness is OK but more than that is the gap I had in mind between just accepting a symbol and freely coding
0:49:36
malice
During quickloading I get an error "illegal function call". Can I somehow learn which function call is illegal?
1:07:55
axion
Yes, you could, but the question was about quickloading so I gave an answer closer to that usage.
1:20:52
axion
Why would you want to do that? If you are writing it to disk, you wouldnt use a namestring, but a pathname
1:26:39
malice
Yes, that's what I'm currently using. I was curious whether there was some better alternative.
1:31:54
malice
As I said, I will receive some string from the internet, so I'm not sure what it will contain. I want to use this string as a filename - so I want to write it to the filesystem.
1:33:08
axion
Then you'll have to encode them in some encoding that works best for your application. Most web stuff is base64 encoded. You can use cl-base64 for that. It accepts a string, octet vector, or stream as input
1:34:27
axion
Or you could just write a binary stream to disk. It really depends what you are doing with these files once on disk.
2:07:43
zulu_inuoe
Is it allowed & kosher to use #+ and #- reader macros in an ASD file? I'd like to load certain components on different platforms
2:10:59
axion
zulu_inuoe: Many many projects do this. https://github.com/rpav/fast-io/blob/master/fast-io.asd#L15
2:12:29
Bike
https://common-lisp.net/project/asdf/asdf/The-defsystem-grammar.html#Feature-dependencies
4:46:59
vtomole
I've heard somewhere (here :https://gist.github.com/chrisdone/516489f4f27846712225#file-anintro-md), That it is hard to write a self intepreter in a statically typed lisp. Is that true?
4:58:47
vtomole
That is different from using type declarations? Type declartions catch type errors at compile-time?
5:18:46
pillton
The standard doesn't specify. Some implementations do catch type errors at compile time.
5:22:00
vtomole
I figure thats the reason type declarations exist. What would be the benefit of an implementation catching errors at runtime with type declarations?
5:23:48
vtomole
Oh and if lisp can catch errors at compile-time, then the amount of misinformation out in the wild is insane (ex. "I don't want to use lisp cause it's dynamically typed")
5:29:33
pjb
vtomole: no, type declarations in Common Lisp is to let the compiler avoid doing any type inference or type checking. It is you being smarter than the compiler!
5:29:33
pillton
Well it is often hard to do since you can call (setf (fdefinition 'my-func) #'new-func) at any time.
5:29:40
White_Flame
and a compiler that really screams loudly if there's any possibility of putting the wrong type somewhere
5:32:37
pillton
I'd rather see a second compiler which sacrifices interactivity for improved analysis.
5:33:20
White_Flame
or even just a manual "bake" and "unbake" user command once you think the system is stable type-wise
5:43:56
edgar-rft
vtomole: the amount of nonsense about lisp can be significantly reduced by listening to sufficiently intelligent people :-)
6:00:03
dmiles
i almost need to take the work "inference" off my irc highlighting expecially now that 95% of the time it is the opposite of interesting :)
6:06:59
pillton
Why is it not interesting? There is nothing stopping an implementation for performing inference/optimizations in code using operators in the CL package.
6:09:58
pillton
Perhaps a CDR could be written to allow for users to create their own immutable packages?
6:14:37
Zhivago
Well, there are some things limiting it -- like which things can be dynamically changed.
6:51:48
malice
Hi! Is there some universal way of protecting against unknown errors? I'm looking for something to wrap the place which is most prone to errors.
6:52:37
malice
Right now I got some error which I could correct by myself(and rewrite the code so it does not happen again), but because I forgot about that, I only have an option to reevaluate slime request(which is basically "start from the beginnning" or killing the thread
6:53:40
pjb
Notice that to be effective, you have to provide the restarts close to the source of the error.
7:08:48
otera
Is there a standard way or library of converting a nested data structure in lisp (could be any or all of plists, alists, hashtables or CLOS objects) into a nested dict in javascript? I'm using parenscript, but it is not a prerequisite.
7:09:17
jackdaniel
minion: memo for knusbaum: try (clim:accepting-values (t) (setf *config-name* (clim:accept 'string :prompt "Config nname:"))
8:15:42
phoe
(car (cdr cons)) - you get the cdr first to get the second cell, then its car to extract the element
8:26:37
axion
I can't find anything in the spec that says this should be possible, but I just stumbled on it accidentally: (format t "~b~%" #(121 33 43)) => #(1111001 100001 101011)
8:27:32
phoe
~B binds *print-escape* to false, *print-radix* to false, *print-base* to 2, and *print-readably* to false.
8:28:32
phoe
from 22.3.2.2 Tilde D: Decimal: "If arg is not an integer, it is printed in ~A format..."
8:30:55
jackdaniel
if you want nth element in the list, use (nth n my-list) where elements are indexed from 0
8:31:24
jackdaniel
if you are making your own lisp, then providing function nth is much simpler than adding all caaddaaaar alternatives
8:32:56
pjb
axion: indeed, the argument "should be an integer", but all implementations (I have on this computer) behave this way.
8:54:09
some-user
how to make run-program to respect my PATH? (run-program "ls" '()) doesn't work because it fails to look into $PATH
8:56:19
pjb
some-user: notice that when using the shell, it will in general load some profile (eg. .bashrc when using bash), and the PATH can be reset in this profile.
8:56:53
pjb
some-user: so if you changed the PATH or just want the one inherited, you may have no other choice than calling fork/execvp yourself.
8:59:14
jackdaniel
some-user: function is described in detail in sbcl manual here: http://sbcl.org/manual/index.html#Running-external-programs
9:00:45
jackdaniel
I don't, you never know when it'll break its api, it's not even documented (unless someone considers docstrings being documentation)
9:06:47
some-user
"(run-program "ls" '() :shell t" - unkown keyword :shell, "(uiop:run-program "ls" nil)" - odd number of key args
9:09:49
jackdaniel
the problem is that uiop instead of making distinction between program and arguments does split by itself
9:13:07
jackdaniel
some-user: regarding update, you may use a library created by Anton for that: https://github.com/avodonosov/ql-asdf-chooser
9:14:06
jackdaniel
(some incompatible changes were introduced, like enforcing using make-operation instead of make-instance to assure singleton objects)
9:15:58
some-user
jackdaniel: got it, thanks, will do as readme says most likeley and update asdf manually
9:22:14
some-user
https://common-lisp.net/project/plexippus-xpath/examples.html#id53256 where can i get (stp:make-builder) from?