freenode/#lisp - IRC Chatlog
Search
15:01:59
Josh_2
I'm trying to generate JSON that looks like "device_keys": {"@alice:example.com": []}
15:03:20
Josh_2
where I can have many @alice.. etc but I keep trying and jojo keeps outputting like "{"device_keys":"[{\"@timestealer:scyldings.com\":[]} .. adding the []
15:03:46
Gnuxie[m]
Ok, there's some dynamic variables for cobtrolling nil if that's the problem trying to get []
15:17:34
Josh_2
yes, but in order to have an object like {name: {o1}, {o2}, {o3}} which is basically the format I need, jojo expects each of o1 o2 to be a slot in a class, but I have a list of them instead, this is why they keep ending up like {name: [{o1},{02}.. ]} etc
15:20:55
Gnuxie[m]
I would just keep the keys in a list/table in a slot and encapsulate access to them, then account for tjat with your to-json method
15:22:41
Gnuxie[m]
Ok, I mean, i'm on a phone rn and no computer but I donmt see anything that woukd stop you doing this
18:36:44
fiddlerwoaroof
Josh_2: I gave up on Jonathan, for some reason: I mostly use Yason these days
19:41:26
fiddlerwoaroof
If I have a loop like (loop for line = (get-line s) while (peek-char nil s) collect line), is there a good way to get the last line?
19:41:50
fiddlerwoaroof
e.g. on a single-line input, you'll just get nil, because WHILE triggers before the collect
19:42:37
fiddlerwoaroof
hmm, maybe I can put the termination test after the collect? I'm never quite sure whether that's conforming
19:44:16
fiddlerwoaroof
Yeah, I guess the only rule is the variable initializations can't be mixed with accumulation or termination tests
19:44:54
_death
White_Flame: nope.. as #lisp helped me find out a while ago, you can't put WHILE before FOR, for example
19:45:20
fiddlerwoaroof
the grammar in the spec specifies `loop [name-clause] {variable-clause}* {main-clause}* `
20:02:11
Nilby
Great exmaples from the great quux, but maybe the Fermat's last theorm part could use an update.
20:35:10
_death
CL-ASHOK: one of the examples has the exact issue I mentioned.. it makes a lot of sense to allow it, but unfortunately it's not the case
20:38:00
specbot
Examples of WHILE and UNTIL clauses: http://www.lispworks.com/reference/HyperSpec/Body/06_adc.htm
20:39:57
_death
here the example is changed.. which is strange, because it indicates that they were aware of the limitation and chose to preserve it
20:41:05
_death
I guess it makes more sense in this particular example.. since the cltl2 version would get () for the empty stack, rather than (0)
20:44:04
_death
also, 6.1.4 keeps this sentence: "Termination-test control constructs can be used anywhere within the loop body."
20:50:21
rpg
mfiano: I believe v5. But I'm not sure -- I just have a JSON schema that says "uuid" -- not that helpful!
20:54:46
mfiano
We wrote it for our game engine, but was recently ripped out into a separate library for the most recent QL dist. Though, not sure how useful strictly v4 may be to you. Hopefully you don't need the MAC-based variant, as that can't really be done with pure CL, and the other libraries use CFFI or OS specifics wrongly here (failed on all of my machines)
20:56:02
rpg
mfiano: The UURL given in Quicklisp doesn't seem to correspond to an extant repo on github....
21:17:31
mfiano
Xach: is homepage required, and does your script fall back to :source-control if not present?