freenode/#lisp - IRC Chatlog
Search
8:30:04
akr
Hello, I'm printing out an argument to my function to figure out what it is, and all I'm getting is "[object Object]"
8:58:33
jdz
akr: no, I mean something that a JavaScript implementation (e.g., browser) would write to the console when an object is converted to a string instead of writing the object itself.
9:01:35
jdz
akr: also, instead of printing the value, you can use BREAK, and the inspector to inspect it.
10:19:54
jack_rabbit
If I declaim it in my repl, will that apply to packages I load with quicklisp and asdf?
10:24:58
jack_rabbit
It would be nice for a user to be able to specify that, so the library writer doesn't have to.
10:38:55
antoszka
Guys, would you be able to point me towards Peter Norvig's note about his PAIP book being not anymore very useful for AI but still considered a very good CL book?
11:09:19
malgrand
hey this is my first time using irc and this just seemed to ask lisp related questions. I was looking to learn a new language and make a text-adventure for fun in that language. Do you guys think that would be a good idea in lisp?
11:11:53
edgar-rft
malgrand, there's a book for learning lisp with lots of games: <http://landoflisp.com/>
11:25:19
lukego
Hey I'm looking at USOCKETS and wondering whether people have already been running this with lots of sockets and e.g. adopting the more hardcore platform-specific select()-like system calls. Anybody been up to such mischief already?
11:26:56
lukego
I'm actually hacking Lisp on a fun project. Story for another time :). But it's jolly pleasant.
11:29:26
lukego
I'm peeking in the USOCKETS code (do we still capitalize symbol names like that? :-)) and I see that on LispWorks Linux it's delegating to a builtin mechanism (MP:NOTICE-FD, MP:UNNOTICE-FD), and on LispWorks Windows it's doing scary Win32 API calls, and on CCL it's calling select() via FFI. Seems quite nice that there is a backend for each platform that provides an easy point to hack. Just vaguely wondering if there are git branches aro
11:36:18
lukego
I've looked briefly at lev. Seems like USOCKET would be the simplest integration point for that? Since you can already access things like file descriptors there to bridge the domain between streams and system calls.
11:38:47
jdz
But everybody was happy to see the Woo performance graph (https://github.com/fukamachi/woo) at ELS 2014.
11:42:39
jdz
lukego: This confirms it: https://github.com/fukamachi/woo/blob/master/src/ev/socket.lisp
11:44:32
lukego
That doesn't suit me because I want something portable. So the best option so far sounds like starting with usocket and hacking one or more backends to use libev.
11:45:44
jdz
lukego: Sure, distracting you from your plan was not my intention. Sorry for all the noise.
11:49:20
beach
I am still in Bordeaux. Though, right now, I am in the airport in Amsterdam waiting for a flight home. What about you? Where are you these days?
11:52:55
lukego
I'm nowadays in a little dairy farming village in the Swiss Alps with a wife, two small boys, and a jack russell. Change of pace :).
12:19:11
sjl
jackdaniel: wasn't aware of that particular one. serapeum has something similar, apparently so does arc
12:23:38
lukego
Howdy fe[nl]ix! I was just thinking it would be awfully nice to use IOLib if I were a little less sensitive to portability at the moment :)
12:45:03
jackdaniel
ACTION has in mind some jokes about polish-polish homonyms, probably bad ones though
13:38:13
makomo
any recommendations for stuff i might read to get an idea/understanding of environment objects?
13:41:51
nowhere_man
I recently published a new draft of BULK, a binary format inspired by Erik Narggum's rant on XML
13:42:31
Bike
makomo: they're pretty undefined. you can pass them to functions that accept them and that's it. no accessors or anything.
13:42:48
nowhere_man
I'm wondering if the way I deal with definition is sensible, so anyone with an interest in PL theory and lexical scoping would be very welcome to criticize my work :-)
14:14:20
nowhere_man
I I understand ASN right, with ASN you define an inflexible ad hoc binary format with it
15:14:48
nowhere_man
dlowe: IIUC, like ASN, they define ad hoc formats, not mutually-compatible formats
15:34:51
White_Flame
nowhere_man: what's the actual use case for BULK? it seems awfully generic, and might not be much smaller in practice than a "minified" plain sexpr representation
15:37:27
White_Flame
we have a generic binary protocol, which does lists, maps, numbers, UTF-8 strings, and a few other bits & bobs, that we use for encoding messages in a distributed system. We considered having a JSON serializer instead of dealing with our own. But converting our types to a JSON type, eg ["map", "key", "val", 123, "val", "123", "val"] or something of the like means that we first convert from our objects to JSON style lists/objects,
15:37:27
White_Flame
then from JSON to byte stream. That's much more cruft to drag around than just serializing to binary in the first place
15:39:13
White_Flame
also, generic formats aren't ever really "mutually compatible". The only thing you can do with XML and its ilk is to deserialize it. Your code has no idea how to work with it if it isn't of the node shapes that it expects
15:40:06
White_Flame
and in modern usage, XML/JSON/etc are bringing such immense loads of fine-grained details that they're not effectively human readable anyway
15:48:41
phoe
theoretically all macroexpansions are human-readable, even in case of LOOP or TRIVIA/OPTIMA patternmatching stuff.
15:55:02
nowhere_man
White_Flame: the goal is to provide a framework for formats like file archives, images, XML documents, with compactness and decentralization
15:55:38
nowhere_man
the decentralization part needs some semantics that do beyong just binary sexpr
15:56:53
White_Flame
phoe: right, same thing. The _use_ of data formats means they're no longer effectively human friendly anymore
16:04:02
White_Flame
nowhere_man: effectively, would you say that it basically allows you to build an ASN-style packed binary format with a format declaration specifier included?
16:20:07
nowhere_man
and if you know a BULK image vocabulary and you parse a BULK stream that is such an image with a metadata vocabulary in it that you don't know, you'll still get the image
16:30:13
dlowe
it seems like the primary innovation here is the namespace with a guid. Is that reasonable?
16:30:55
dlowe
from my experience with protobufs, there are rather huge wins involved if you have a partially-parseable format that is uniformly used everywhere
16:33:09
White_Flame
nothing happens to the lexical binding, you mean. Certainly something can happen to the toplevel binding ;)
16:34:04
White_Flame
if BLAH is declared special via defvar or whatever, then the LET is a dynamic binding
16:34:30
White_Flame
but if it's only ever been setf'd and not declared special, then we would get this split situation
16:35:58
oleo
say i want to ensure a global variable retains it's original value outside of some some other program unbinding it
16:36:24
White_Flame
first google hit for me: https://groups.google.com/forum/#!topic/comp.lang.lisp/WtsTkRdqOWg
16:36:51
oleo
global-variable here -> subscope-where-it-gets-unbound-> reswitch to the surrounding env
16:37:27
White_Flame
or (let ((*global-var* *global-var*)) ...) if you want to pass through the existing value
16:37:57
White_Flame
I do a lot of this sort of thing in thread pooling. Load up a bunch of dynamic bindings like that for the current context, and let some job rip
16:38:21
oleo
i looked at the code today and was wondering why output-translations were deleted for it
16:39:58
oleo
that means while maxima gets built my output-translations are gone, that's fine so far
16:41:06
oleo
but i'm loading an asdf system which calls the maxima compilation, and after maxima compiles it looses cause the output-translations are gone
16:56:23
oleo
having saved the output-translations to *init-hooks* wouldn't work either in that case i think
16:58:27
oleo
that stuff was thought for pure maxima toplevel compilation, not some environment around it
17:11:11
jmercouris
Hey everyone, I made some really simple survey software in Lisp if anyone is interested in using it /building off of it: https://github.com/atlas-engineer/survey
17:11:41
jmercouris
it is pretty cool because you can make http requests with XML bodies to the service to dynamically create surveys
17:18:46
jmercouris
White_Flame: I'm toying with the idea of expanding this into a platform like DISQUS where it is open source, and you can run your own service, or you can use mine
17:19:24
jmercouris
White_Flame: anyways, this software was actually developed to answer the question that we talked about earlier, is there a demand for a service to group the packages/ship them cheaper
17:21:23
jmercouris
having said all of this, making it work with sexpr wouldn't be a huge leap in logic, the xml is already transformed via s-xml:parse-xml-string
17:24:08
jmercouris
anyways, not a super huge priority right now, for now I just plan to use the tool
18:00:58
aeth
White_Flame: I've brought this up in the past, but I don't like any current JSON library that I'm aware of
18:08:30
aeth
I guess JSON and YAML support are probably on the weaker side for Lisp compared to comparable languages because with a lot of the use cases people just use s-expressions as data
18:19:19
aeth
White_Flame: You can solve that by not allowing bare lists. When decoding, simply tag it with an extra cons like e.g. [] => '(json-array)
18:19:34
flip214
I'd like to have a set of functions give the caller notice of some conditions, and thought I'd just (THROW :no-filter-found nil) and CATCH that (as NIL already means "no data").
18:19:40
aeth
And require the same thing when encoding because otherwise you can't disambiguate between lists-as-sequences and lists-as-alists/plists
18:19:43
White_Flame
right, and that goes down the territory of "seem to be designed to make lisp <-> json hard" ;)
18:21:32
White_Flame
CATCH will act like a PROGN on normal return, and return the respective THROWn value otherwise
18:21:57
flip214
I'd have to (BLOCK nil (CATCH :no-filter-found (return (some-function))) (code-for-no-filter))
18:22:12
aeth
(list 1 2 3) => error; (list 'json-array 1 2 3) => [1, 2, 3]; (list 'plist :foo 42) => {"foo" : 42} or {"FOO" : 42} depending on settings and/or print-case. Default for symbols to JSON strings probably should be to :upcase into CL and :downcase into JSON strings, although obviously that won't work for arbitrary JSON, where case sensitivity might matter.
18:23:00
flip214
White_Flame: so I'd still have to bind the result and check that against EQuality of some keywords?
18:23:55
aeth
White_Flame: But lisp <-> json can't be perfect because you'd have to decide on the default for json -> lisp. I'd choose json array to Lisp vector (not list!) and json object to hash table (not plist or alist!) as the default, personally. Closest semantic match. But json objects are also equally valid as plists, alists, structs, and CLOS objects and json arrays could also be lists.
18:24:33
flip214
White_Flame: that means that I have to pass :no-filter-found at least three times - in the THROW, in the CATCH, and in a CASE clause. that doesn't feel so nice.
18:24:52
White_Flame
aeth: yeah, I know. I've dealt with a lot of that. I was just reinforcing that anything you come up with equals your assessment of "seems to be designed to make lisp <-> json hard"
18:25:37
flip214
White_Flame: currently the "main" return value is a list of records - or NIL for "no records".
18:27:30
flip214
from the inner function - yes. the outer one needs to catch that [sic ;] and replace with another data set.
18:27:43
aeth
White_Flame: I guess the solution is probably more JSON (no comments!) as metadata that could be used to override (library or program) default choices and allow for a round trip even when e.g. a struct and a CLOS object are both serialized.
18:28:02
flip214
well, currently I'm just _directly_ returning :no-filter-found - and check for that, so the keywords is only used two times.
18:28:20
White_Flame
or the inner function should just return the replacement set instead of a tag indicating the replacement set should be used
18:28:55
flip214
White_Flame: the thing is, there is not _one_ inner function - it's a set of methods, and I don't want each to have to know the default.
18:29:24
flip214
perhaps that would be better still - either return data, or (values NIL :no-filter-found) etc.
18:30:57
White_Flame
the value is only special if it's intermixed with other things. If you have a set-aside value slot for it, it need only be boolean
18:31:33
flip214
so right now I could simply pass :no-filter-found and treat that as a generalized boolean.
18:33:04
flip214
as I said, THROWing a special CONDITION seemed like an appropriate use -- I don't use them that often ;)
18:35:35
eschulte_
is there an easy way to search quicklisp for all packages which use a particular package?
18:35:37
flip214
well, it's a nonlocal transfer of the control flow - I put that in the same box as conditions.
18:38:25
eschulte_
I'd like to supply a system name and get back a list of every system in quicklisp which :depends-on that system. Just first-level (non-transitive) dependencies would be fine.
19:25:26
oleo
(defparameter *x* 0) (let ((*x* 1)) (sb-thread:join-thread (sb-thread:make-thread (lambda () (let ((*x* *x*)) *x*))))) -> 0
19:25:36
oleo
(defparameter *x* 0) (let ((*x* 1)) (sb-thread:join-thread (sb-thread:make-thread (lambda () (let ((*x* 1)) *x*))))) -> 1
19:32:23
oleo
(let ((*x* 1)) (sb-thread:join-thread (sb-thread:make-thread (lambda () (let ((*x* *x*)) (setf *x* "abc")))))) -> "abc"
19:33:29
oleo
so read the global value eventually, if you don't bind it, but write only to your own version
19:38:20
oleo
(let ((*x* 1)) (sb-thread:join-thread (sb-thread:make-thread (lambda () (setf *x* "abc")))) -> "abc"