freenode/lisp - IRC Chatlog
Search
2:24:04
azrazalea
Anyone know of the top of their head if there is a good quicklisp library for watching a filesystem directory for changes and then firing a function? I found one but it is a simple sleep loop and i'd prefer something smarter. I only need linux support.
5:28:35
azrazalea
jackdaniel: Yeah, I found those after I asked(thanks cliki as well!). Currently working on a cl-inotify solution but i'm having to implement recursive watching. Taking a shower before I start on it in earnest
5:29:13
azrazalea
whoman: I probably could(though I'd have to learn how to do that as well), I just am doing this in lisp and would prefer to continue doing so.
5:29:42
azrazalea
I'll share once i'm done. It is pretty simple, just auto rebuilding coleslaw so hutchentoot can serve updates automagically
5:30:51
azrazalea
Adding some kind of browser hook to auto refresh would be the next step but I probably won't bother
6:07:59
beach
Your implementation typically stores the length (or some similar metric) somewhere at the beginning of the array.
6:09:09
axion
Can you provide me with a test form that will likely yield differing timings vs a list?
6:12:52
axion
As a quick test: (time (dotimes (i 1000) (length (apply #'vector `(,@ (loop :for i :below 100000 :collect i))))))
6:13:59
beach
Common Lisp initializes the elements of a newly created array, so creating one takes time proportional to its length.
6:27:18
Bike
i mean, if you don't specify initial element or anything the array contents are uninitialized, and reading them is undefined
6:30:01
beach
I certainly hope every existing Common Lisp implementation does not count on that possibility to return an uninitialized array.
6:31:45
beach
Note to self: Specify what will happen if initial-element is not given in Common Lisp version 3 (which will be called something different to avoid confusion with existing projects).
6:39:27
beach
For those who don't know: I have a long-term project to create an updated Common Lisp standard.
6:39:28
beach
The only difference between the updated standard and the current one will be that much behavior that is indicated as unspecified or undefined in the current standard will be specified and defined. In particular when it corresponds to what every implementation (that we care about) behaves that way.
7:05:47
axion
I'm working on extending my doubly linked list data structure implementation, as it was pretty naive. I'm encountering some interesting hurdles with the optimization I employed.
7:22:14
jackdaniel
hscl reminds me boringcc principles: https://groups.google.com/forum/m/#!msg/boring-crypto/48qa1kWignU/o8GGp2K1DAAJ
7:22:59
jackdaniel
another approach, which is fully standard compatible would be signalling conditions whenever programmer tries to depend on undefined / underspecified mechanism
7:25:39
beach
But yes, if there is no reasonable action to take, then signaling an error is an option.
7:46:21
azrazalea
This is what I ended up with https://gitlab.com/azrazalea/azrazalea-net/blob/master/functions.lisp
7:46:32
azrazalea
With the addition of https://gitlab.com/azrazalea/coleslaw/commit/577053276c87833bd2419e9928d5924b6c655a68 to coleslaw
8:19:58
jack_rabbit
How do common lisps deal with infinitely recursive macro expansions? They obviously can't fully expand them at compile-time.
8:22:09
jack_rabbit
but doing further expansion at runtime inside a compiled function seems like it would require modifying a compiled function on the fly.
8:27:07
jack_rabbit
aha. okay, so when I enter that and evaluate (foo (1)) at the repl, it works. Trying to compile a file with it fails with blown stack, as I would have expected.
8:28:51
jack_rabbit
I was just surprised it worked in the repl. Guess it doesn't do full expansion when it's interpreting.
8:32:54
edgar-rft
jack_rabbit: an infinite stack is an inevitable requirement for infinite recursion, infinite compile-time will be next ... :-)
8:36:29
jack_rabbit
I know it can't *actually* recur infinitely, but if you expand only as necessary you can still evaluate a form.
8:43:09
edgar-rft
If your macro non-recursively expands into a recursive helper-function or a LABELS form you can implement run-time checks for the recursion depth.