freenode/#lisp - IRC Chatlog
Search
5:55:31
aeth
stylewarning: It depends. If it's something like shortening names to make them easier to type, that usually makes things worse, just get some form of autocomplete. But if it's removing a variable, that often makes the code clearer imo.
6:01:53
aeth
stylewarning: mapcar itself is sort of an example of this. It's basically just maplist where you're calling car on every variable.
6:02:05
aeth
a one variable version could be implemented as trivially as: (defun mapcar* (function list &rest more-lists) (declare (ignore more-lists)) (maplist (lambda (x) (funcall function (car x))) list))
6:59:30
slyrus1
Shinmera: it's probably not relevant given iclendar, but did have you seen my https://github.com/slyrus/soiree/blob/master/icalendar.lisp
8:08:36
Shinmera
iclendar can't parse things as it is, only produce them, but I would certainly welcome a parser addition to it.
8:14:09
slyrus1
It would be great if all of these were combined into one library/suite that could read and write icalendar/vcard and talk to caldav/carddav servers.
8:17:43
slyrus1
soiree does parsing but not serializing, iclendar looks like it does serialzing but not parsing...
9:24:45
hjudt
i have a design question: i am developing a web application which reads data from a hash-table. The hash-table gets updated (on demand), this process is usually very fast. nothing else writes to that hash table except the update method. do i still need to protect the hash-table with locking in every place it gets accessed? is there a better solution? i need a data structe like a hashtable because lookup would
9:26:05
phoe
some implementations have synchronized hash tables that are good for concurrent acccess.
9:28:41
phoe
you can simply #'(SETF GETHASH) and all the synchronization is going to happen in the background
11:07:27
phoe
so one thread blocks until the second thread handles the condition originating in the first thread?
11:07:45
phoe
or is it "fire and forget" where the thread does whatever after "sending" the condition object to a different thread?
11:08:12
shka_
phoe: thread1 waits for thread2 to finish, thread2 signals error, thread1 has logic to handle error
11:09:37
phoe
thread2 has a handler that sends the condition object to thread1 and blocks waiting for response, thread1 sends the "result" of how to handle error back to thread2, thread2 reacts accordingly
11:19:06
jackdaniel
shka_: I don't understand the use case here -- why would you handle error in parent thread instead of a child thread?
11:20:39
shka_
jackdaniel: because otherwise i will need user to know details about internal implementation
11:21:10
zigpaw
maybe you could want to handle errors in an aggregate manner probably? (in some algorithms, where only a significant percent of errors require automatic reaction), but even then you can do it on the same thread and just pass the counter to error-handling thread (supervisor).
11:21:47
jackdaniel
I mean why do you want something like (handle-thread (fork (error "hi"))) instead of (fork (handle-thread (error "hi"))) ?
11:21:51
zigpaw
so having something like producer-consumer, between failing threads and error-handling thread?
11:25:43
jackdaniel
ah, so you are fixed on your left-grabbing-right-pocket mindset. in that case I won't interfere
11:26:02
zigpaw
shka_ : more like just an idea I got for such a use case, it is not exhaustive. In most cases I can think of I don't see such architecture needed.
11:27:37
shka_
zigpaw: essentially i have library that introduces RANGES (like iterators, just with few extra elements)
11:29:48
shka_
if i could introduce way to allow part of pipe to run on separate thread, i could speed up few use cases
11:32:19
shka_
because range can be constructed by internal function and user can't do anything with that
11:36:45
zigpaw
yeah, that seems a reasonable use-case. but probably you'll have to catch the condition on the failing thread and pass that somehow to the parent thread. That is the one thing I don't like in most impl of threads in various oses, the child doesn't know their parent. Some languages do have easier to use constructs for parent-child communication, lik
11:36:45
zigpaw
e erlang or go with their channels, I'm quite sure CL have those too but I'm not that good in CL to have any experience in this regard (and I don't know about overhead which it surely have).
11:40:01
zigpaw
I mean for inter-thread communication that you would probably need to establish for each and every thread.
11:46:45
zigpaw
great, then you are probably all set up :-) at the end you may even wrap it into a function/macro and have it ready as a multi-purpose thing?
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