freenode/#lisp - IRC Chatlog
Search
18:56:41
minion
gabbiel, memo from pjb: the &environment parameter is required to handle things like (let ((x 42) (y 33)) (list 'outer (symbol-macrolet ((y x)) (list 'inner (save-place (y) (setf y 0) (list x y)) (list 'mid x y))) x y)) #| --> (outer (inner (0 0) (mid 42 42)) 42 33) |#
19:02:00
Josh_2
hmm you reckon I would be able to implement Guiles fibers library in CL then? It was a suggestion for my 4th year project, but it isn't built on pthreads
19:06:26
Bike
"In Guile we implemented exceptions in terms of delimited continuations and dynamic binding" oh hey, same hat
19:30:25
skidd0
not per se. I'm wondering if being able to use the Inspector outside of a debugger is on the 'roadmap'
19:32:23
pjb
skidd0: I don't know vim (only vi). But I'd guess you know the equivalent of M-x in vim.
19:34:43
skidd0
vlime (an alternative) can handle the inspect command because of a different REPL setup
19:35:58
pjb
I don't know where the slimv or vlime developpers hang. You'd have to ask them, or do it yourself.
19:37:39
pjb
Note: this is why slime is preferable: then you'd just use emacs lisp which is very close to common lisp to modify or add features.
19:44:24
defunkydrummer
skidd0: from the URL you quoted: "Vlime has a rather different REPL implementation, which enables swank-presentations, that means you can copy & paste most of the values returned by the REPL, like you can in Emacs. Slimv cannot do this AFAIK." --> this means you can't do what you want
19:44:51
defunkydrummer
if I understand the description there right, you can't use presentations on SLIMV
19:45:54
skidd0
i'm currently conducting "research" (web searching reddit and quara threads) on emacs and evil mode, vim-mode, etc
19:48:07
defunkydrummer
if it's worth anything, I didn't know anything about Emacs and then I took the task of Lisp development using Emacs and SLIME. It only took me about 3 or 4 days to get comfortable,and now I quite like it.
19:50:21
skidd0
ah. yes. sometimes it's best to ive in rather than test the water (my curent "research")
19:51:32
dim
you could install Spacemacs and dive in as you say, maybe with https://github.com/mfiano/common-lisp-sly or equivalent
19:55:39
sjl_
skidd0: I use vlime. I tried slimv and didn't like it, but I'm happy with vlime. If slimv is feeling limiting to you it might be worth giving vlime a go.
19:56:52
sjl_
Ah, I don't use the Vlime repl much. I open a terminal split in Vim and run the lisp process right in there
19:59:16
dim
what about writing a CL LSP server and allowing people to use vscode and other open source "modern" editors that way? ;-)
20:00:17
dim
skidd0: I mean they all have vim modal editing capabilities, or most of them do, right?
20:00:59
sjl_
dim: in the last blog post I wrote I mentioned that that would be a good idea. I just don't have the time/willpower to do it myself
20:01:34
sjl_
but yeah, I think it would be beneficial to the community to have an LSP server (probably piggybacking off of swank to do the dirty work behind the scenes)
20:02:12
sjl_
I did some work at my last job writing an LSP server for Scala that used IntelliJ as a backend, so I know exactly how ugly the sausage can get.
20:03:28
sjl_
oh, I've never seen that. I saw https://github.com/cxxxr/cl-lsp but it was unlicensed when I originally looked (now it looks like it's MIT, cool)
20:06:48
sjl_
looking through the code I can't find where they actually implement any of the actual LSP things...
21:02:15
skidd0
dim: i added common-lisp-sly to my .spacemacs file and tried to reload it but it says that layer can't be found
21:16:13
dim
sorry I just pointed you to an interesting (?) direction, I use SLIME in Emacs myself and install slime support via Quicklisp
22:34:42
defunkydrummer
open question to all: I need to search a text (inside a string, maximum ~ 10 KB) to find a specific string, and the search must be fuzzy, because the string contains an OCR'ed text. Which library should I use? Montezuma?
22:35:31
defunkydrummer
also, it would be great if I could say: "search for the presence of string F001-0002 near string INVOICE"
22:36:02
defunkydrummer
although I guess I could do that simply, if i can obtain the byte.position of each search result
22:37:01
defunkydrummer
if you have a suggestion, please tell our slave bot, MINION, to leave a memo for me
23:03:31
asdf_asdf_asdf
Hi. If I have defined alien routine. It how assign this routine to variable, that type alien was alien, not another?
23:05:46
asdf_asdf_asdf
(defien-alien-routine "WindowProc" ...) (let ((res2 'WindowProc)) ...) => Undefined alien: "WindowProc"
23:18:46
aeth
asdf_asdf_asdf: You picked one of the most advanced topics in Common Lisp (and then picked an implementation-specific approach for it, which probably means 5 people in the world can answer your questions). Just use someone else's winapi bindings unless those are somehow not enough, in which case you should use some autowrapper like cl-autowrap or claw.
23:19:32
aeth
(And those 5 people might not use IRC, might not use CL anymore, or might not have a Windows box)
23:28:05
aeth
I mean, go ahead with your approach if you want. If you succeed, then the number of people becomes 6, but it might take years.
23:30:41
defunkydrummer
asdf_asdf_asdf: did you see the URLs i left for you? this guy has several bindings to various Win32 APIs: https://github.com/fjames86
0:56:24
aeth
(remove-if-not is the subject of an intense tabs-vs-spaces-level debate over whether or not it should be used because it is probably the most common of the deprecated functions)
1:17:36
aeth
It looks like people talked about the topic 2-3 times in the past year here. https://irclog.tymoon.eu/freenode/%23lisp?from=2018-05-16T21%3A15%3A14&to=2019-05-17T09%3A15%3A14&search=remove-if-not&by
1:17:50
no-defun-allowed
remove-if and remove-if-not are extraneous just do (loop for item in list when (funcall test item) collect item)
1:19:08
aeth
no-defun-allowed: Is there a vector-equivalent to collect, though? remove-if is sequence-generic, not a list function.
1:20:04
aeth
no-defun-allowed: Just as a heuristic... you will probably need two implementations for any sequence function since what's best for lists and what's best for vectors tend to be different.
1:21:21
aeth
That's because removing from the middle of a vector is messy if you have to keep the order (if order doesn't matter you just move the last element into the removed element's spot)
1:22:57
aeth
If order didn't matter it would just be (subseq foo 0 (- length-foo (1+ matches))) and then overwrite the matches in the copy with the stuff that didn't get copied
1:24:06
aeth
With order mattering you'll have to make a new list at the size of (- length-foo (1+ matches)) and then, in a second iteration, copy element-by-element if not a match afaik.
1:25:31
no-defun-allowed
is vector-push-extend usually O(1)? could use an adjustable vector and guess the size (eg 1/2 the original)
1:26:06
Bike
usually it's amortized constant time, i think. assuming nothing weird happens with the allocation anyway
1:27:38
aeth
With my approach I guess the second loop would be something like this: (loop :for item :in original :with i := 0 :when (funcall test item) :do (progn (setf (aref new-vector i) item) (incf i)))
1:28:37
aeth
It would be complicated a bit because the type would have to match and there are a lot of 1D array types
5:46:53
no-defun-allowed
If I destroy a thread (using bordeaux-threads), will locks it held be freed?