freenode/#lisp - IRC Chatlog
Search
4:03:10
didi`
How do I control how FORMAT's ~S and ~A will print my structure? I want ~S to print my structure as it normally does (#S(...)) but I want ~A to print the structure differently, in a more eye-candy way.
4:05:47
no-defun-allowed
"If [p-e is] true, an attempt is made to print an expression in such a way that it can be read again to produce an equal expression."
4:16:43
didi`
Hum. I wonder if there's a way to only implementing the aesthetic printing, i.e. I don't want to re-inplement the default printing because o it.
4:46:11
ggole
(defmethod print-object :around ((f foo) stream) (if (and (null *print-readably*) (null *print-escape*)) (format stream "FANCY") (call-next-method)))
4:55:23
ggole
That's probably a bit silly though, since if you wanted specific printing for foo you would just put it in the other arm of the if
6:27:21
emaczen
fiddlerwoaroof: I added some code to ensure execution in the main thread, but I still get the message from the OS saying that GNUstep is not responding. Any ideas?
6:30:06
emaczen
Well, perhaps my code does not ensure execution on the main thread, but regardless I've tried performSelectorOnMainThread:withObject:waitUntilDone: passing a NSWindow and the makeKeyAndOrderFront: selector as the arguments
7:16:23
emaczen
I just tried calling NSApplicationMain, and I don't get that OS warning anymore, but now my REPL thread is tied up
7:17:23
emaczen
No, I put something together using #/performSelectorOnMainThread:withObject:waitUntilDone:
7:22:12
emaczen
When you call my function #'execute-in-main-thread which takes a function as an argument, it redefines an objective-c method called #/runInMain that calls the function via a CFFI callback and then runs #/performSelectorOnMainThread:withObject:waitUntilDone: with an NSObject, the runInMain selector that was just defined, a null pointer and then I've tried yes and no for the last argument
7:23:42
emaczen
The function that I've been passing to #'execute-in-main-thread is typical objective-c code to create an autorelease pool, a NSApplication, and a Window
7:31:36
fiddlerwoaroof
Hmm, I'm not sure if that breaks the rule about calling into lisp from foreign threads
7:32:47
fiddlerwoaroof
"Direct calls to pthread_create (instead of MAKE-THREAD) create threads that SBCL is not aware of, these are called foreign threads. Currently, it is not possible to run Lisp code in such threads."
7:34:15
fiddlerwoaroof
I guess you're not directly calling that pthread function, but I'm a bit unsure if an objc selector that switches the thread a bit of code runs in has issues
7:38:06
emaczen
I'm going to try adding format forms to print sb-thread:*current-thread* and (sb-thread:main-thread)
8:12:47
Ukari
Josh_2, " jackdaniel: Ukari: atomic operations are in develop branch (not in 16.1.3 release)"
14:07:39
phoe
If we have a paragraph of text, let's say, "Hello world dhfjhdf world!", what spellchecking algorithm should we utilize?
14:08:12
phoe
Should we split that paragraph into ("Hello" "world" "dhfjhdf" "world") and spellcheck those?
14:08:40
phoe
And if a word fails the check, should we report back the position of the offending word in the original paragraph?
14:09:48
beach
What are your other options? I mean, if you check the spelling of each individual word without any context, that is what you have to do it seems. No?
14:25:16
edgar-rft
phoe: there's a company named Dhfjhdfnzhou that might match your pattern: <https://www.companiess.com/dhfjhdf_info683568.html>
14:27:48
therik
Hello, I've got a little hobby project that I've never finished few years ago, it uses CL in the background for calculations and node.js in the front to talk to clients. The two are connected via socket and can send messages to each other. I'm thinking of extracting this connection in packages and putting it on github, quicklisp and npm. Do you think people might find it useful?