libera/#commonlisp - IRC Chatlog
Search
16:11:25
gendl
Hi does anyone know how, in a typical CL, we could implement a file watch watch capability, Whereby some function will be triggered when it's detected that a file has changed on disk.
16:13:15
gendl
I could imagine a background thread which sleeps and wakes every 10 seconds and checks the file but that sounds kind of inefficient - node has a --watch flag where the command reacts instantaneously to file changes — But I can't believe they are doing busy waiting or even sleep & wake loop... are they?
16:17:32
gendl
My only issue with Shinmera's libraries are they are written with a case convention that breaks modern-mode allegro and the author has stated that on principle he would refuse fixes for same (He doesn't see them as fixes of course) And so if I want to use the libraries I have to fork them and maintain my own fork
16:18:03
Shinmera
or you could just, you know, not load libraries with modern mode active. as it should be done, anyway.
16:21:53
semz
wouldn't any kind of symbol generation like (intern (concatenate 'string "FOO-" name)) also break it?
16:23:14
gendl
The intern example above would not per se break it, But you would end up with a symbol exactly as you created maybe upper case maybe lower case maybe mixed case
16:23:54
gendl
Which I think is the same behavior in ansi mode depending on how you construct the symbol
16:24:06
smlckz
is there a system of common lisp standard library reference in the manner of man pages?
16:26:20
gendl
Anyway most of what I'm doing these days is not modern mode stuff so I can try shinmera's libraries there. Then try porting to modern mode if and when that seems to make sense.
16:28:03
jackdaniel
shouldn't intern take the string as it is? (i.e disregarding modern or normal mode)
16:28:35
pjb
jackdaniel: the question is (intern (concatenate 'string "FOO-" name)) vs (intern (concatenate 'string "foo-" name))
16:29:18
jackdaniel
then the question is lost on me, one will give a symbol with a name "FOO-/something" and another with a name "foo-/something/"
16:29:59
pjb
jackdaniel: but in modern mode, I guess (intern (concatenate 'string "FOO-" name)) would or should give |foo-/something/|
16:30:29
pjb
smlckz: some distributions have a hyperspec package, or you can download the tarball from lispworks site.
16:30:32
jackdaniel
pjb: that doesn't make sense though? because you deliberely supplly the symbol name?
16:36:28
gendl
Modern mode has a case sensitive readable (which by itself doesn't violate ansi) but then all CL symbols are interned in lowercase. And that last part violates ansi just a tiny bit.
16:37:44
gendl
It reads T case-sensitively and that does not match the Lisp's idea of t which is lowercase.
16:45:17
gendl
So.. either port the Shinmeraware to work on modern mode.. or port the few modern mode apps I'm supporting off modern mode. That latter is sounding like it might make sense.
16:46:08
gendl
I remember how mad Erik Naggum got at Franz when they released modern-mode. After he'd loved them so much.
16:47:24
gendl
Readable-case :invert gives most of the benefits of modern mode w/o running afoul of ansi.
16:48:22
gendl
And Dropping modern mode from our builds would cut allegro-based build times in half.
16:51:21
gendl
I think I was talked into modern mode back in the day without real good reason (it was not someone at franz). I think modern mode made some internal stuff Franz was doing more convenient for them, so since thay had it they said what the hey let's release it people might like it. Bit I don't think they've ever heavily promoted it.
16:58:27
jackdaniel
is there a scheme implementation called schism? files would have an extension .ism
17:58:27
mathrick
<gendl> Readable-case :invert gives most of the benefits of modern mode w/o running afoul of ansi. <-- Shinmera's code will break with :invert too
18:01:04
gendl
Yes but at least one can arrange to change readtable case back to default when compiling/loading shinmeraware. Modern mode is a whole separate image.
18:02:39
mathrick
Bike: argh, this is really not fun to debug, but I don't think I can stop, cause it breaks in more ways than I thought originally. Current status: seems that threads are involved, but not all threads. Just loading Verbose or cl-async is enough to break it, but creating a thread pool with 48 threads is fine. I'm now thinking that the weird persistent behaviour is not actually related to anything being saved in FASLs, but to whether the compiler is
18:03:48
mathrick
if I have two consecutive calls to the function that explodes after a change to its code is made, the first one works, but the second one sees the corruption
18:04:35
Bike
in situations like this i usually assume i've angered a witch, or possibly a congregation of gremlins
18:04:57
Bike
i think aeth mentioned a while back that you could be modifying a literal by accident- that is the kind of thing that could result in weird crap like that, so i'd be on the lookout
18:05:03
mathrick
gendl: also, if you come up with an automated way to compile shinmeraware / other stuff that doesn't play well with atypical readtable-case, I want a copy. I've given up on :invert in the past because of that
18:06:05
mathrick
although I thought modern SBCL allocated literals in the read-only segments, so it shouldn't even be possible to modify them
18:07:50
gendl
Yes modern mode needs to be a separate image because built in CL official symbols are all literally in lowercase. That's the ansi violation.
18:11:00
gendl
mathrick: cause :invert still reads mixed-case symbols in a case-preserving way, right?
18:13:30
mathrick
Bike: oh, because LOAD-TIME-VALUE will be evaluated if the compiler is active, but loaded from saved value otherwise?
18:14:23
mathrick
yeah, I was looking at the spec the other day, but it's one of the corners of the language I really don't understand well
18:15:52
Bike
like, you can do (defun inc () (incf (car (load-time-value (list 0))))) to make a counter - each call will increment
18:20:33
mathrick
are there any other literals than '(...) that are easy to modify in a spec-violating way? I don't use any array literals that I'm aware of, and no string modification that I know of either
18:21:25
mathrick
I reviewed all the instances of '(...) I could find, and as I thought, they were all in a read-only context because I've learnt my lesson about only using literals when I know what will happen to them back when I started using CL
18:32:57
mathrick
that's conceivable, but what makes me suspicious is that the thing that reliably makes it break for me is cl-openal + cffi:with-foreign-ptr + Verbose, but Shinmera's code also uses that AFAIK
18:34:55
mathrick
hmmm, I do have a custom Trivia pattern that works around the fact that '(foo 42) matches (name (&rest args)), but I don't think it could result in anything being modified
18:38:41
mathrick
at this point, I just want to find a reasonably small repro case I could submit for smarter people than me to look at, and also a workaround so I can move forward and work on what I'm actually trying to do
18:49:14
Shinmera
an openal backend for cl-mixed is on the todo, but I don't need it, because I already interface directly with the operating system APIs, which the other wrappers like openal ultimately do, too, anyway
18:50:52
mathrick
Shinmera: I've used OpenAL enough now to be able to say that it's an extremely poorly-designed API and if you have wrappers already, using it would be a step back, at least for plain output
18:51:39
mathrick
there's *some* merit to using OpenAL for 3D spatialised audio, but it's just a really bad design
18:51:50
Josh_2
::notify lips123mob BKNR doesn't properly handle :initform when modifying class definitions
18:52:24
Shinmera
libmixed has its own spatial audio system, though I think it's bugged at the moment.
18:52:44
Shinmera
Will get to fixing and polishing that whenever I get to preprod for Next Game Project(tm)
20:03:47
jcowan
I suppose you could emulate modern mode with a package modern-cl whose contents are symbols named "car", "cdr", etc and have their definitions copied over.
20:09:05
aeth
no library does (symbol-name '#:foo) because it's longer even though it's more correct
22:28:02
pjb
Josh_2: nope. Packages only have symbols. That said, method combinations are named with symbols.
22:28:28
Josh_2
If I define a method combination in X and :use X in Y will my method combination be found?
22:29:21
pjb
But you can also refer the method combination with a qualified symbol: x::my-method-combin