freenode/#lisp - IRC Chatlog
Search
13:02:41
AeroNotix
First time thinking I might need eval-when. I have some constant values that are a pain to write out in full. I can write a small piece of code to create them instead. Do I want to use eval-when :compile to compute the constants at compile time or shall I choose a different method?
14:14:31
russellw
What's the naming convention for variants? Like if I have a function named foo, and I want to create another function similar to it but slightly different, so a slight variant of the name, that would be foo' in ML?
14:36:55
AeroNotix
https://ml.cddddr.org/quinquevirate/ the standardization process was so politicized
14:39:23
AeroNotix
https://ml.cddddr.org/quinquevirate/msg00287.html I love the anti european sentiment too.
14:40:02
AeroNotix
It's filled with that kind of sentiment. Quite funny since nowadays I tend to see far more non-American lispers
14:40:48
phoe
"it didn't occur to me that the LeLisp and Cambridge Lisp people, with a combined user community of maybe 50 people, might have such an influence."
14:43:40
AeroNotix
varjag: the language exists separately from the community in most respects. I see a lot of rpg-isms in this channel regularly. I can ignore it. Though, despite ignoring it, I can still classify it=.
14:44:07
mason
AeroNotix: It shouldn't, but seeing what look like modern, well-formed emails from 1986 seems odd. :)
14:47:13
Xach
https://soundcloud.com/zach-beane/peter-seibel-common-lisp <-- peter's talk about CL history, including these rivalries
14:50:18
russellw
You can read one thing from the current input stream with (read). But suppose what you want is to read as many things as are in the input stream, up to the end of file; how do you do that? Experiment so far says trying to read when there is end of file is an error
14:50:42
Xach
russellw: READ has an option to return a particular object rather than signal an error
14:51:17
Xach
russellw: one trick is to use the stream object itself, which is something that READ would normally not return (NIL is usually a bad choice because NIL is a pretty normal thing to READ)
15:02:35
oni-on-ion
oh gosh, the ethics of programming, if computers and devs and runtimes etc had manners and forms of speech!
15:03:26
oni-on-ion
if it would please you, sir, it would be best to create an object, and it would be especially convenient if this were an array of size 20, but thats cool if you can't
15:05:01
oni-on-ion
AeroNotix: i didnt see what you were talking about sorry. im responding to phoe's code line there.
15:05:31
jkordani_
error: speech pattern mismatch ^but thats cool if you can't^ is too informal. Also you're missing an '
15:20:20
russellw
CCL when my program contains an error, spits out five screens of output when I really just want the first couple of lines. What's the best way to get just the first couple of lines?
15:21:27
Xach
russellw: are you using Clozure CL directly? (not mediated by slime or something like it)
15:23:49
russellw
hmm, in the process of trying to capture the output for paste, I discovered it sends the first two lines to stderr and the rest to stdout. Which in itself suggests a way to separate them. But to proceed with paste anyway
15:24:25
Xach
The clozure cl debugger is usually not very verbose, so it may be something else producing a bunch of output.
15:26:27
Xach
Oh, one option would be to not run things in batch, but interactively and iteratively develop things, and then (if needed) make changes for batch purposes.
15:27:08
Xach
russellw: there may be one. but the reason it prints that stuff in batch mode is there is no way to get it in another way, because the program is over.
15:27:08
russellw
Xach, my number one criterion for choosing a programming language is ability to run things in batch; I find that so much more productive
15:28:38
russellw
If you find interactive/incremental works better for you, then by all means you should do things the way you find best!
15:28:59
Xach
Mikel Evins had an analogy that matched my experience - working with languages like Smalltalk or Common Lisp is like teaching an eager assistant how to get the job done. Other environments are more like developing a recipe or set of plans to hand off.
15:29:24
russellw
dlowe, I write my program as a set of text files, and each time I want to test it, I type a command in the command line
15:29:56
_death
Lisp programmers write their programs as a set of functions, and when they want to test them they type a form in the REPL
15:32:57
jackdaniel
unless you distribute binaries as if in save-lisp-and-die, it might be worth to restart image and try to load your application (even without reboot:)
15:33:38
jackdaniel
some could argue, that clean deployment should be done from environment, where asdf doesn't have access to personal repositories too
18:05:37
pjb
In lisp you would want an implementation that offers real-time guarantees with the garbage collector for example.
18:05:43
jackdaniel
if it is lisp, you have a gc puzzle to solve (though it's something possible to overcome from what I've heard)
18:06:05
pjb
Or at least, an implementation where you can disable (temporarily) the garbage collector.
18:06:41
pjb
You could become instant lisp hero, by implementing a real-time garbage collector in some CL implementation (eg. sbcl or ccl).
18:07:40
pjb
Now, while there's little guarantee, you could study the GC algorithms used, and compute an upper limit to the time spent by the GC, given the memory size.
18:09:23
pjb
The point here is that hard-real-time is parameterized by a response time, and this response time doesn't need to be small.
18:10:58
pjb
For example, you get a telemetry packet from a sonde on Mars. You guarantee that you can answer back command in one hour ± 30 second. top
18:14:03
pjb
Have a look at com.informatimago.common-lisp.cesarum.activity ; there are others in quicklisp too.
18:16:51
pjb
razzy: note that real-time and run-time are given in more precise increments than universal-time, but they're not based on a specific epoch. I have code to adjust them to the same epoch as universal-time.
18:18:01
pjb
mkdir -p ~/quicklisp/local-projects/com ; git clone https://github.com/informatimago/lisp.git ~/quicklisp/local-projects/com/informatimago
18:19:10
pjb
(ql:quickload :com.informatimago.common-lisp.interactive) (use-package :com.informatimago.common-lisp.interactive.interactive)
19:37:06
shka_
anyway, i think that there is no way to make handler-bind work with transfered errors
19:40:19
pjb
(handler-bind ((error (lambda (err) (return (send-condition-to-other-trhread-and-get-answer err))))) (do-something))
19:41:44
pjb
Now, in the other thread, dyou don't need a hander-bind, you can just handle the condition when you receive it. Since it must return the result and send it back to the original thread for handling by handler-bind.
19:42:03
shka_
pjb: just one question: do you think that i can make interactive restarts thread-transparent?
19:42:55
pjb
Well, implementations usually do it the other way: they allow several thread to be in the debugger, and the user may switch the debugger UI from one thread to the other.
19:43:46
pjb
But you could do it like you want. You only would have to collect the restarts in the debugged thread,a nd pass them along with the condition, to let the debugger thread do the UI, and return back the decision.
19:47:28
pjb
Now, if you want to use an existing debugger, you would have to restablish the restart names and resignal the condition, but you wouldn't have the same stack frames.
20:34:39
AeroNotix
(qtapropos "QString") and (find-qtclass "QString") don't seem to have it. I've ensure-smoke'd everything possible
20:55:40
phoe
AeroNotix: you can translate Lisp strings to octets, Qtools should be able to read a vector of ub8 as QByteArray
20:56:49
AeroNotix
I get there is automatic marshalign between QString and lisp strings but it wouldn't hurt to have it available, surely?
20:57:51
Shinmera
Anyway, it seems CommonQt unmarshals char* to String, so maybe just QByteArray::data will get you a string?
21:00:59
Shinmera
Well the problem with the QtWebKit bindings available from CommonQt is that they're real old by now :/
21:02:05
phoe
Shinmera: I'd prefer something offline - I'll be deploying an app and I don't want everyone to share the same key.
21:03:34
jmercouris
phoe: look for stuff that is in public domain, I'm sure there is something on project gutenberg
21:05:40
Shinmera
phoe: bundle hunspell or something would be my suggestion, if that feature is really needed at all.
21:07:18
edgar-rft
phoe: make creating a dictionary part of the game and let the users write it themselves
21:09:01
jmercouris
I don't have a good internet connection at the moment, otherwise I would link a few
21:09:08
edgar-rft
dictionary data is dead easy to get but to sort out the unwanted stuff takes ages
21:09:51
jmercouris
I've been working with NLP tools, and I think that the community has done a great deal to ensure quality, accessible data exists
21:10:39
jmercouris
also what is unwanted stuff? infrequently appearing definitions? very easy to remove them when you just do some simple statistics on a corpus
21:12:35
edgar-rft
jmercouris: dictionary data tends to be *huge*, rolplayers do not need to waste gigabytes of ram for dictionary data like NLP folks usually do. They often only need a subset of a big dictionary, therefore my suggestion to let the users write the dictionary themselves
21:13:21
jmercouris
well, maybe you can scrape forums of roleplayers or their conversations on twitter, and then determine which words need to exist as definitions
21:13:38
jmercouris
then you could also automatically extract definitions from where they exist in the corpus by training a model
21:14:01
jmercouris
people generally start definitions in the same way, so you wouldn't need a very large training set to get meaningful results
21:14:31
phoe
Dictionary lookups are going to happen a few times per minute at most, I'm fine with accessing a flatfile and fseeking to it as long as I have an index
21:18:31
edgar-rft
As a non-english speaker I often skim dictionaries for learning interesting words, I assume phoe wants it for similar purposes
23:02:38
ealfonso
can I write a nested destructuring list macro argument as an &optional or &key argument?
23:04:15
Bike
like if you have (&key (x y)) it will interpret that as keyword :x, variable x, default y
23:06:58
jasom
ealfonso: oh, be aware that (uiop:pathname-parent-directory-pathname #p"/foo/bar") => #p"/" because the parent directory of the file bar in the directory /foo is /
23:08:17
jasom
ealfonso: if you want to have the parameter always treated as a directory you can use uiop:ensure-directory-pathname on it first
23:13:51
ealfonso
Bike I want to allow the macro user to provide a two-type (sym form) where form uses sym. But I don't want to make them required
23:15:06
specbot
Specifiers for keyword parameters: http://www.lispworks.com/reference/HyperSpec/Body/03_dad.htm
23:15:44
jasom
ealfonso: note from that link the example of: (&key ((:radix radix)) ((:type type) 'integer)) ...)
23:18:09
ealfonso
I see. I guess I can replace :type with (var1 var2) and 'integer with the corresponding default to get nested destructuring?
23:21:38
Bike
so like, if you have (&key ((:type (a b) '(x y)))), you could pass :type (3 4) or something.
23:34:39
it3ration
I use Clojure in my day job and have been an Emacs hacker for about a decade - I'm trying to understand how Common Lisp handles (or if it has) any similar way of namespacing the way Clojure does
23:37:32
it3ration
specifically, in Clojure you can distinguish between the same keyword defined in separate namespaces, for example, :user/foobar
23:38:34
AeroNotix
it3ration: http://www.gigamonkeys.com/book/programming-in-the-large-packages-and-symbols.html
23:39:11
Bike
i mean, for example for &key parameters, you can use arbitrary symbols, so there's namespacing there
23:40:30
AeroNotix
it3ration: it's a good book. It doesn't treat CL as some kind of God Language like a lot of other SLW books do
23:41:03
serichsen
Ah sorry, FSET is not exactly right, but there are several hits for "common lisp lazy" on duckduckgo.
23:42:48
it3ration
I've been pretty spoiled by Clojure's immutability, concurrency primitives, laziness, and consistency - I've used Emacs Lisp for years but never played with CL, it's very different from Clojure
23:44:15
AeroNotix
it3ration: aside from core.async do you actually use the other primitives regularly? I wrote clojure for a couple of years professionally and none of my problems fit those use-cases
23:46:09
p_l
it3ration: you can write :ns/keyword style in CL, it will just bundle the whole thing after : as symbol name
23:56:44
AeroNotix
it3ration: yeah, just interested in what you actually use. I never found any of them fit many problems. ESPECIALLY the STM
0:36:55
jasom
It seems to be more common to explicitly iterate over a generator function rather than have a lazy list
0:41:37
aeth
What's the best way to assert two things? If you assert them separately, you risk the user correcting the 2nd assert by providing something that fails the 1st assert. If you assert them together, then the user does not know which of the two failed in particular.