freenode/#lisp - IRC Chatlog
Search
14:13:49
pjb
Exercice for a lazy week end: write a CL reader macro to read expressions from such ascii-art representations.
14:14:44
pjb
If you've finished by this evening, follow up tomorrow (assuming it'll be a raining Sunday) with a reader macro to interpret ascii-art graph diagrams into state machine functions.
14:16:41
pjb
Bonus points for combining it with https://github.com/dhobsd/asciitosvg to generate nice documentations.
14:23:51
mo`
is there a way to prevent emacs from blocking stumpwm when I call emacsclient for the mode-line, is there a way to do a timeout for the stumpwm:run-shell-command function ?
14:24:31
mo`
I have (:eval (string-trim '(#\Newline #\") (stumpwm:run-shell-command "emacsclient -e \"(emms-track-description (emms-playlist-current-selected-track))\"" t))) for my mode-line
14:40:17
tazjin
is there a built-in macro for using `(in-package)` in a limited scope? Something like `(with-package ...)`? Failing to google for it.
14:44:20
Shinmera
Because the reader needs to read a full expression, long before things are evaluated.
14:45:34
Shinmera
So a "with-package" cannot possibly work, unless the package change should only influence package and read operations at run time.
15:17:31
Bike
you could have a reader macro that does something similar. a couple implementations allow package::(form...) syntax which i think basically just binds *package*
15:17:54
puchacz
hi, is it a good idea, guys? (setf (symbol-function 'alphanumericp) (symbol-function 'lispworks:unicode-alphanumericp))
15:18:15
puchacz
it works, for example now I can query (alphanumericp (code-char 322)) and it returns T
15:19:40
Bike
kind of unfortunate that lispworks doesn't just use unicode alphanumericp as regular alphanumericp
15:19:42
phoe
"alphabetic n., adj. 1. adj. (of a character) being one of the standard characters A through Z or a through z, or being any implementation-defined character that has case, or being some other graphic character defined by the implementation to be alphabetic[1]. "
15:21:26
Shinmera
Never rely on CL's character set tests if you're working against any kind of specification.
15:21:41
phoe
I'd rather go for #+lispworks unicode-alphanumericp #-lispworks alphanumericp if anything
15:22:11
puchacz
yeah. but cl-ppcre fails to recognise some letters because of this (it uses alphanumeric-p), and hell knows what else does not work with unicode
15:23:02
puchacz
(setf (symbol-function 'alphanumericp) ...) may be undefined but it works under current LW
15:25:01
puchacz
if I put it into .lispworks and remove my .cache/common-lisp, it should recompile cl-ppcre with new function
15:25:04
phoe
puchacz: either ask lispworks for a workaround or file a bug on CL-PPCRE asking for special-casing LispWorks.
15:25:34
Bike
i kind of thought ppcre already special cased lispworks by using some regex engine lispworks provides
15:26:02
puchacz
I already asked them and they told me they have very close equivalents for the functions I need: http://www.lispworks.com/documentation/lw70/LW/html/lw-198.htm
15:27:01
Bike
okay. just be aware that this reassignment is undefined behavior and lispworks could change it without warning (though they're probably not that mean)
15:27:27
puchacz
of course. if they do, I will kindly ask them to restore or merge these functions :-)
15:28:56
phoe
and possibly write a LispWorks-specific test case in CL-PPCRE's unit test suite to make sure it works and keeps on working later.
15:30:30
puchacz
ok - I will have a look. test case is simple, anything like this (scan "\\w" (format nil "~a" (code-char 322)))
15:31:21
Bike
the ppcre docs already include a note that \w has different behavior by implementation on superascii characters, so they might not care
15:32:26
|3b|
they defined their implementation characters to not have CL case, so consistent with not being alphabetic
15:34:35
puchacz
for what I understand, CL should be able to support almost all unicode, except for cases where a small letter has more than one capital equivalents, or a capital letter more than one small equivalents
15:34:35
|3b|
yeah, both seem like reasonable choices to me... sbcl gives you something that probably works well enough to trick you into filling over some edge case, while lw makes you do the extra work to start with (assuming the other API would actually handle the edge cases better)
15:35:28
Bike
there's stuff like unicode characters that don't round trip through case conversions, i think
15:35:52
|3b|
puchacz: ok, maybe just trick me (and other people who don't use those characters with odd up/downcase rules) :)
15:35:53
puchacz
I thought SBCL philosophy is to treat unicode incompatibilities as bugs, except for these roundtrips myself and Bike mentioned
15:36:55
Bike
"case mapping can change the number of code points and/or code units of a string," "is context-sensitive (a character in the input string may map differently depending on surrounding characters)" jesus
15:44:41
porky11
when I use hunchentoot, can I get the uri as variable instead of automatically dispatching?
15:46:01
Shinmera
porky11: You can add a function to hunchentoot:*dispatch-table*. It should get the request object as an argument, from which you can get the URI.
15:48:23
puchacz
FYI: this is working hands-off: (let ((lispworks:*handle-warn-on-redefinition* :quiet)) (setf (symbol-function 'alphanumericp) (symbol-function 'lispworks:unicode-alphanumericp)))
15:52:58
Shinmera
Some internal machinery could depend on the previous behaviour of the function and then do very bad and hard to debug things if you change it
15:55:30
puchacz
Shinmera: yes, but I still need to do it myself first (i.e. #+lispworks replacements)
15:57:47
puchacz
slime who-calls shows functions usage - unless somebody passes it as 'alphanumericp instead of #'alphanumericp, so again it is not reliable way to find
15:59:11
pjb
puchacz: there are also the case where one lower case letter is upcased to two uppercase letters.
15:59:41
puchacz
pjb: yes, but I can't do anything about that. exactly - the German example I mentioned
16:00:19
puchacz
pjb: I want as good multilingual support as I can get, but if I can't, well, I skip this case
16:01:25
puchacz
pjb: I can use them :) it is the rest of quicklisp and lisp itself that might not play well
16:02:37
pjb
And we have to deal with objects that have been created or defined in the past, that still exist and need to be processed now (and in the future).
16:03:22
pjb
So either the program remains neutral (don't try to process the data fields), or it has to include a lot of complexity.
17:18:00
phoe
Yep. You may want to use one of the frameworks on top of Hunchentoot that parse URLs for you.
20:13:12
flip214
re puri: http://www.cliki.net/Puri says http://puri.b9.com/, but this doesn't exist any more.
20:31:33
flip214
fiddlerwoaroof_: well, I can argue that the northbridge-southbridge connection connects the "thinking" parts with the "change the environment" parts, so there's not that much difference
20:48:59
yomanwazap
It had a green alien with multiple eyes in it that was holding a sign calling "Lern Lisp" with his trunk.
21:15:40
tetrachlorides
"I'd like to learn Russian but I have no time to memorize this funny alphabet." - Someone wrote a blog post complaining about that remark. :/
21:18:55
tazjin
Bike: there was some very brief talk about eastern european languages yesterday, maybe tetrachlorides is referring to that.
21:19:22
Bike
i think learning the alphabet is probably not the longest time investment of learning any language?
21:20:11
tazjin
tetrachlorides: do you have a link to that post? I'm not sure if you're referring to my remark about learning Russian (which wasn't about the alphabet) but it sounds interesting anyways
21:21:28
tetrachlorides
i thought some of you guys were oversensitive, but people really do complain http://blog.roberthahn.ca/articles/2006/02/09/lisp-first-impressions/
21:23:40
phoe
the lack of a complete and featureful Lisp editor that isn't emacs or vi has been a topic of many debates on #lisp so far
21:24:54
phoe
plugin for atom is incomplete and buggy, plugins for other editors don't exist afaik. I remember that jasom has been working on a geany plugin AFAIR