freenode/#lisp - IRC Chatlog
Search
9:41:24
osune_
hm, I would lie saying that this is an answer that satisfies me. But I guess it has to. Thanks
9:44:00
Shinmera
Another way to look at it is that the TZ is the difference between local time and UTC.
9:47:15
osune_
I guess you can look at it that way, and maybe I didn't had enough exposure to TZ problems to appreciate it. But apart from your guess (inheritance) there seems no valid reason why one would choose to implement it that way, or at least expose this implementation detail it to the user
9:52:09
osune_
I mean: assuming that there is no benefit for solving specific problems by working with (- TZ), I assume that there are other reasons to use (- TZ) internaly. But as there are no specific problems which benefit from (- TZ) it doesn't make sense to expose this detail to the user. (decode-universal-time) could just return (- (- TZ)) and work with (- TZ) internal.
9:53:53
Shinmera
A lot of things in CL aren't there because that's what they thought was cool and great to have, but it's there because of the constraints under which CL was formed.
9:55:10
osune_
Shinmera: sure that's a valid reason, which I'm not arguing. That's why I said "I take it as an answer". But this just propagates the question to "why did one existing system initially choose to behave like that"
9:55:59
Shinmera
Either way, as I said, seeing the TZ as the difference between local time and UTC (thus being "inverted") seems like a reasonable way to do things to me.
10:07:06
osune_
Sure it is just that. But I was not aware that "East to UTC is negative" was ever a wide spread convention.
10:08:10
beach
Possibly. But it is possible that there didn't used to be a convention at all, so Lisp implementers had to pick one.
10:13:29
osune_
I'm reading up on the history of time zones atm and acording to wikipedia "By 1929, most major countries had adopted hourly time zones [with reference to GMT]. Nepal was the last country to adopt a standard offset , shifting slightly to UTC+5:45 in 1986" https://en.wikipedia.org/wiki/Time_zone#Worldwide_time_zones Currently I'm looking through the different ISO standards for time zones and dates / time
10:16:17
beach
You might try to look at the Maclisp manual and see whether the convention was the same as in Common Lisp. If so, Shinmera is very likely right in that the Lisp function existed before the current convention was established.
10:19:23
osune_
beach: thanks i'll have a look. It seems the first standard regarding representation of local time differentials was ISO4031 from 1978 , which was superseeded in 1988 by ISO8601. Unfortunately I don't find a public version of ISO4031. So it seems Shinmera is right with his guess.
10:31:32
osune_
The MacLisp Reference Manual by Moon (1974) doesn't seem to even know about time zones :/
10:36:31
osune_
I have a friend searching for the ISO 4031 standard, maybe I'll find the "horrible" truth there :D
10:45:05
aeth
It's not just the negation, the actual timezone information itself is different iirc. ISO 8601 encodes DST directly in its UTC offset. CL can thus given a different UTC offest than Unix's (or is it just GNU's?) "date -Isecond"
10:46:54
Shinmera
I really hate the thing about changing TZs with the DST, so I prefer CL in that regard
10:54:21
osune_
Well no luck: my friend says the truth hidden in ISO 4031 is so horrible that he has no access via the university he is working at. I'm assuming it contains eldritch type horrors which are better left untouched.
10:55:06
aeth
Turns out that that conspiracy theory about someone just making up hundreds of years of history was true and is incoded in ISO 4031? Incredible!
11:25:34
osune_
aeth: wait a sec . You said "Its not just the negation". I didn't read ISO 8601 , but your sentence implies that there it is stated something like "as it is known, in the west of Greenwhich the offset is positive in the east it's negative. But for what ever reason we negate the offset". Or do I missunderstood ?
13:15:49
p_l
if someone has L-bus Symbolics in need of parts, there are boards for $200 on sale https://www.ebay.com/sch/71271.1417/m.html?_nkw=&_armrs=1&_ipg=&_from=
13:44:29
eviltofu
So when I insert a (break) into my code, I run it; when the debugger shows up. I type print "var name"?
13:46:40
Shinmera
You can just hit return on the stack frame and it'll show you the lexical variables it knows about
13:47:03
Shinmera
ones it does not show won't be available anyway because they've been compiled away.
13:57:58
Shinmera
In other news, Colleen can now provide lookup similar to specbot for most of my libraries and projects.
13:58:16
Colleen
Function 3d-vectors:vunit https://shinmera.github.io/3d-vectors#FUNCTION%203D-VECTORS%3AVUNIT
13:58:52
Colleen
Unknown command. Possible matches: 8, say, roll, set, mop, get, reload, ramble, login, grant,
14:25:27
beach
eviltofu: When the execution stops because of the BREAK, you will see a window with one line for each currently active stack frame. If you put your cursor at the beginning of such a line and hit return, you should see the lexical variables that are still live.
14:25:58
beach
eviltofu: All that assumes that you compiled your program with a high value for DEBUG.
14:26:28
Shinmera
Or just the unit that you're breaking in. You can use C-u C-c C-c to compile a block with high debug.
14:29:40
Shinmera
You can also inspect the values by clicking on them or moving the cursor to them and hitting return
14:32:05
Shinmera
For values on the repl you can also easily inspect the last one with slime using M-x slime-inspect * RET
15:39:35
malice
Anyone knows drakma? Can I somehow check headers of the request sent by http-request? I'm interested in headers created when using cookies.
18:16:50
junxit
I'm using drakma to connect to several APIs, and one of them is coming back with "error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version" ... I have a call that works in curl from the command line (MacOSX), but doesn't work from drakma ...other API calls to different sites work fine. I'm not sure what the next step in troubleshooting is, any suggestions?
18:39:34
rpg
junxit: Just from reading that, I wonder if Drakma is doing the authentication wrong. It looks like maybe you're using TLS and you have the wrong version?
18:40:20
junxit
yeah, but I'm not finding how to change/force that ... it's weird that it is only the one site that does it.
18:40:53
junxit
I tested it on a remote linux box, and it works. It also has always worked in the past *sigh*
18:41:06
rpg
junxit: You probably need to figure out first if it's an error in Drakma, or an error in the remote site.
18:41:49
junxit
I tested the same call using curl from the command line (outside of lisp) and it works.
18:44:16
rpg
junxit: All the run with curl tells you is that curl and the remote site are compatible. Unless you know how curl's behavior differs from Drakma's behavior, you are not much further along (except that you know that the remote site isn't just plain broken).
18:45:05
rpg
A good start in debugging might be to look at curl's command-line options and see if there's some auth setting that will make curl *also* break. That might help narrow things down. Or you get into Drakma and start tracing things. Or both
18:50:12
tomlukeywood
how would i initialise all the elements of an array with a value in common lisp?
18:52:15
junxit
yeah, they're Jira APIs and it seems to be a problem with my laptop as it works on a remote linux box
18:53:39
junxit
both drakma and dexador throw the same SSL error `A failure in the SSL library occurred on handle #<A Foreign Pointer #x1506150> (return code: 1).
18:57:00
junxit
@tomlukeywood use :initial-element or :initial-contents ... :initial-element sets all elements to the same value, :initial-contents you have to specify a value for every element in the array
19:00:08
junxit
@rumbler31 new laptop, so not using macports/homebrew .. openssl and curl seem to be stock
19:02:56
junxit
yep, 1795:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:/BuildRoot/Library/Caches/com.apple.xbs/Sources/OpenSSL098/OpenSSL098-64.50.7/src/ssl/s23_lib.c:185:
19:07:28
junxit
I've been putting off an update to Xcode, I'll update and see. If not, I'll install the homebrew version of openssl
19:08:51
junxit
also, the same openssl command connects to the other sites that *are* working. I'm going to guess that they updated the Jira server over the holiday, and it introduced an incompatibility
19:11:51
tomlukeywood
i am trying to give constants as parameters to (make-array) however i get an error when doing so. what is the correct way?
19:15:04
Xach
tomlukeywood: '(foo bar) evaluates is a list of two symbols. (list foo bar) will evaluate to a list of the value of two variables, FOO and BAR.
19:15:49
Xach
tomlukeywood: also, it's good to syntactically mark constants so they don't clash with other bindings.
19:16:34
Xach
tomlukeywood: In CL I often see constants marked with crosses, like +rows+ and +columns+
19:18:58
rpg
I think Robert Strandh has a lisp style guide somewhere on the web that covers this sort of thing. It was very good, I thought.
19:29:19
rpg_
I can't find it any more. If he's around, and doesn't object, I'd be happy to share it.
19:48:49
shka
rpg: here it is https://github.com/robert-strandh/SICL/blob/master/Specification/chap-general-coding-style.tex
19:54:50
phoe
github should auto-render TeX files in its preview, or at least offer it as an option.
19:55:33
fiddlerwoaroof
loop is lispy because a lisp is fundamentally just a way to write a bunch of domain specific languages to solve your problems in :)
19:59:15
phoe
LISP actually stands for Language Idiom Subdomain Protocol, which is a set of rules for developing custom DSLs to resolve particular classes of problems.
20:08:35
phoe
gah, I want to sit down and work on the UltraSpec. real life knows different though and keeps on throwing health/family/various other real life issues at me. I don't expect to be able to sit down and focus on it for the next 2+ months.
20:09:44
phoe
jmercouris: I'm just freaking sorry to let down all the people who offer me support at the moment and tell them that I'm not yet ready to lead the way.
20:10:13
jmercouris
phoe: Yeah, I can understand that, but it's okay, we are all human, with likely similar issues
20:10:55
phoe
I did a crapload of work converting things to DokuWiki and this work is right now pretty much useless for further work because I'm the only person around here right now who knows the details of DokuWiki format that I chose and the kinks and culprits of the current files.
20:11:37
phoe
I screwed up by that, I should have started from the beginning with distributed knowledge instead of knowledge that's stuck in my head and I have no time to sit down and utilize it.
20:12:00
phoe
well, shit. the only excuse I have is, all things take their time in the land of Lisp.
20:12:11
jmercouris
I think it's a good thing to share your experience, because maybe someone reading this channel log will avoid the same
20:13:22
rpg
Is there anything like a PATHNAME-DESIGNATOR-P function? Kind of hate to keep writing (or (stringp x) (pathnamep x))
20:14:23
Shinmera
All pathname functions take designators already so if something falls outside of that it'll error.
20:14:59
rpg
Shinmera: I have something like the case in CFFI -- I want to be able to supply an s-expression that evaluates to a pathname, in place of a pathname.
20:16:36
jmercouris
jasom: Hey jasom, I was wondering, would you like to be mentioned in the release credits?
20:17:45
rpg
Shinmera: I'm running experiments, and I want to dump a *portable* file designator into the output. E.g., I want the experiment file to report that the data was in (asdf:system-relative-pathname "experiments" "datafile1")
20:18:25
rpg
So I have a table of file designators that are s-expressions that can be printed into the script and then get evaluated to point to real files.
20:20:55
Shinmera
rpg: Use a macro that emits a quoted and unquoted version. One for printing, the other for the value.
20:21:20
Shinmera
rpg: I still don't quite understand though-- what pathname do you want to output? The one in which your experiment resides or?
20:21:58
jmercouris
Can anyone please help with a CFFI issue I'm having, getting the return back from a function: https://gist.github.com/875972985687a4d9d0f4afb80cb77975
20:22:23
rpg
Shinmera: I want to emit into a transcript file the *portable* file designator (the asdf:system-relative-pathname expression), so that the experiments can be replicated, but I need to evaluate them to actually get the data to process.
20:22:43
jmercouris
Within my callback, "callbacky" I'm trying to get the value of: webkit-javascript-result-get-value
20:22:57
Shinmera
(defmacro foo (expr) `(list :value ,expr :expr ',expr)) ; (foo (make-pathname :name "a")) => (:value "a" :expr (make-pathname :name "a"))
20:23:00
Xach
rpg: If it were me, I'd store the arguments to asdf:system-relative-pathname and apply them later. I would not use eval.
20:24:51
rpg
If this was more than a one off, I think you two would be right, but since it's a one off -- and not exposed to anyone to be a security threat -- these solutions smell like over-thinking.
20:26:00
rpg
Shinmera: I know how to do this if I'm going to do it right, but there's also an issue of knowing what's the proper cost-benefit tradeoff.
20:26:18
Shinmera
I've yet to encounter a problem that I could solve significantly faster with eval.
20:26:50
jasom
jmercouris: also if you named it scratchy.lisp instead of scratch.txt gist would syntax highlight it
20:28:03
Shinmera
shka: I'll want at least 90% of the profits off of that novel as royalties for that sentence.
20:28:04
jasom
jmercouris: reading the webkit docs, you get a pointer to a JSValue, the address of that pointer appears to be #X7FFFF002C830
20:29:45
jmercouris
jasom: Right, but given that pointer, how do I get that value at that pointer in lisp?
20:29:57
jasom
jmercouris: https://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebView.html#webkit-web-view-run-javascript-finish
20:31:14
jasom
it's probably worthwhile to write a function to convert a JSValueRef to a lisp value, but you need to deal with NaN and Infinity that don't exist in lisp
20:31:50
Bike
most implementations use ieee floats i think, yhou just don't usually get a hold of them
20:32:10
rpg
Xach, Shinmera: I think there's a temptation to try to always to The Right Thing, but it's important also not to confuse production code with a utility script.
20:32:48
Shinmera
rpg: You can do whatever you want, naturally, but I can also criticise you for it. Your choice whether you want to let that bother you :)
20:33:24
Bike
jmercouris: the c code here checks whether value (the result from webkit_javascript_result_get_value) is a javascript string, and if it is, makes a c string with its data. you'd have to do similarly.
20:33:48
jmercouris
Bike: So in my code example I posted, I just want to assume for now that the result is a string
20:34:32
Shinmera
IF you don't need to keep value identity you could just serialise to JSON and parse that lisp native, and back.
20:36:11
Bike
how else would it work? if it can return any javascript value there has to be some kind of type information, it couldn't just be a c string
20:36:28
jmercouris
Bike: It should ALWAYS return a string, because all javascript values may be represented by JSON
20:36:55
Bike
that's like having a lisp system where everything was printed to string before being passed around
20:53:54
jmercouris
Is there some sort of thing like sldb-eval-with-break, so I don't have to change the function and re-eval it with a break inside?
20:54:16
jmercouris
Better yet, is there a good guide someone may reccomend for debugging with slime?
20:54:50
jasom
jmercouris: sbcl does have a stepper, I think you need to compile with a high level of debug for it to be useful though
20:55:27
jmercouris
There seem to be few faculties for support it and they are implementation dependent
21:01:48
aeth
jasom: on the other hand, debugging in languages that only have one implementation is portable across all implementations
21:04:09
jmercouris
jasom: So if you look in the C code you'll see I need to invoke JSValueToStringCopy, but this isn't provided by cl-webkit, how might I go about calling it? Do I have to do something like (cffi:defcfun "JSValueToStringCopy" :string) string-result (context JSGlobalContextRef) (value :pointer) ())?
21:04:49
jmercouris
How do I even know which library provides JSValueToStringCopy as in their example?
21:27:43
rpg
Stepping is definitely available in Allegro, but only for code that's interpreted, not compiled, IIRC (may have improved -- don't use it much)