libera/#commonlisp - IRC Chatlog
Search
10:51:30
jackdaniel
wasn't uiop advertised as a stand alone library that you may pull from quicklisp? ,p
10:52:08
jackdaniel
I'm not planning to update asdf since 3.2 release (and forward) broke too many things - afaik these are still not fixed
10:53:13
shka
jackdaniel: well, i feel like i miss something, you mean that uiop/launch-program is actually implemented for ECL?
10:54:12
jackdaniel
last time I've checked launch-program and run-program in uiop had some horrible indirection ingrained
10:59:44
jackdaniel
contrapunctus: yes, there were some problems with gather-op on recompilation too
11:00:18
jackdaniel
(because it tried to pack .so files in a single archive), but I think that this one is ifxed
13:06:37
jackdaniel
fourt and fourthmost, cursory glance at this code is enough for me to feel compelled to give you an advice - don't bother with macros until you get a good grasp of programming without macros
13:09:45
flip214
jackdaniel: but confusion is the best way to realize how much there's still to learn!
13:10:39
flip214
Got me a good one when I wrote a macro that declares a class and a WITH-macro for that class
13:10:55
flip214
jackdaniel: well, how would you see that you don't understand something - unless you feel confused?
13:12:02
jackdaniel
I don't feel confused about rust, but I'm aware that I don't know anything about it ,)
13:12:46
jackdaniel
also, there is a difference between being confused by something new and confusing oneself with going too deep into the water
13:13:32
zacque
> "what makes you think that an atom doesn't need evaluation" <= Oh, makes sense! I'm being naive here. I thought simply comparing the symbol to NIL will do...
13:14:32
jackdaniel
if you want to check whether something has a known value at compilation time, you may do (when (constantp <foo>) (eval foo))
13:16:36
rotateq
zacque: But did you learn the basics by now? Or that the lambda list of CL:IF is (test then &optional else).
13:22:16
rotateq
What would make a bit more sense can be to think about how to write IF with COND or COND with IF if this level is yet achieved. Or how WHEN and UNLESS are written.
13:24:46
jackdaniel
(defmacro if (test true false) `((lambda () (or (and ((lambda () ,test)) ((lambda () ,true))) ((lambda () ,false))))
13:25:09
zacque
Thanks! My confusion comes from me thinking that special operators in Lisp have to be defined as macros...
13:25:49
jackdaniel
special operators may be defined by a wizard inside the implementation, they don't have to follow rules
13:26:16
rotateq
zacque: No, you can view them as elementary, we have 25 special operators. Macros are programs that generate other programs.
13:27:34
zacque
With that realisation, I think I can define it easily as a function wrapper around CL:IF, see: https://paste.debian.net/1240695/
13:28:10
zacque
Since NIL is not yet defined to evaluated to itself, I'll simply check (EQ <FOO> 'NIL)
13:30:01
jackdaniel
perhaps you are in a situation, when the value of <foo> is not known to be nil at compilation time?
13:30:31
zacque
Oh, maybe the first thing I should do is define NIL to evaluate to NIL and T => T...
13:30:34
Bike
IF as a function does not work. with your if, (if t (print "a") (print "b")) prints both.
13:32:09
_death
one could define a FIF function.. it would receive test, consequent, and alternative functions, and pick which of the latter two to call based on the result of calling the first
15:11:34
mrcom
For anyone who so my msg about "can't dump..." (and cares), it appears that SBCL started treating a DEFCONST struct object as a literal in (more) places.
15:12:25
edgar-rft
bollu: not in the emacs sense, in Common Lisp you can use :before, :after, and :around methods instead
15:13:58
jackdaniel
if you declaim your function notinline, then you may replace it with a trampiline
15:14:11
jackdaniel
there you could put your advices at the expense of performance penatly for a trampoline
15:14:28
mrcom
What I was depending upon was it being treated as a singleton, so I had a latent bug in my code.
15:14:28
bollu
maybe this is an XY problem. I want to add some logging around my calls to `uiop:run-program`. I can just search and replace `uiop:run-program` with `run-program-wrapper`. I was hoping I could use some CL facility to make this nicer
15:47:52
White_Flame
the *slime-events* buffer does show what's being communicated, but I don't know if that form is what goes over the wire directly
15:48:48
jackdaniel
there were other languages that used slime, i.e clojure -- https://github.com/technomancy/swank-clojure
15:50:24
White_Flame
if you have the repl and *slime-events* visible, and you enter (+ 1 1) in the repl, you'll see messages for the parameter documentation for #'+, as well as the presentation rendering for the results
15:53:19
bollu
I'm https://github.com/slime/slime/blob/master/swank.lisp#L865-L870 <- this seems to be where messages are sent over the stream?
15:53:55
bollu
https://github.com/slime/slime/blob/68c58c0194ff03cd147fcec99f0ee90ba9178875/swank/rpc.lisp#L100-L107 <- this seems to be the encoding?
15:58:02
bollu
Naive question: why is there no """21st century""" Common LISP IDE if it seems somewhat easy to talk to a LISP Repl via SWANK?
15:59:00
White_Flame
but it's also more of an editor than an IDE, eg no project management, no connection between files, etc
15:59:35
bollu
I'm reasonably happy with emacs; I was more wondering about the state of the ecosystem
15:59:54
jackdaniel
bollu: I've mentioned numerous well regarded IDE programs that have support for common lisp
15:59:58
White_Flame
I, for one, am a reluctant emacs user because it's simply the common case for lisp dev
16:00:11
beach
bollu: We are (very slowly) working on such a thing, but it won't use a wire protocol to talk to a Common Lisp implementation. It will run in one.
16:01:38
bollu
beach by "it will run in one", do you mean the IDE will run within a common lisp implementation?
16:05:02
beach
Well, at least one participant in this channels has said something to the effect of "I will NEVER use an IDE that runs in the same Common Lisp image as the code being developed."
16:07:09
jackdaniel
that's not unreasonable given that lisp images happen to get corrupted. I know that SICL plans to make a "safe" system that may always recover itself from user program errors, but people act on things they know
16:07:22
beach
I think the reasoning is that the Common Lisp system might crash, and then you would also lose your editing session. But then, I think the Common Lisp system should be fixed so that it doesn't crash.
16:07:35
jackdaniel
perhaps this person will change their attitude when they will learn that sicl is indeed that sturdy
16:08:22
beach
It is true that many (all?) current implementations allow the programmer to do unsafe things, and then it could indeed crash.
16:10:57
_death
an operating system can enforce process quotas and limit their effect on the rest of the system.. if you want everything to be in a single Lisp image, you probably need to implement such mechanisms
16:13:07
beach
_death: I think there are several possible levels of safety. At the very least, the system should not crash as a result of a silly mistake such as blowing the call stack or allocating too much live data.
16:13:39
beach
_death: But if the programmer really wants to do things like FFI, then it is hard to prevent I guess.
16:14:01
mrcom
bollu: When you're comparing development environments you're really comparing, for example, Java+Jetbeans vs. Lisp+Emacs.
16:16:12
mrcom
"Wouldn't it be nice if you could do a one-click refactor and rename a function." Yep, it would.
16:17:55
mrcom
However, that's a relatively simple thing for Java. You basically just replace one set of text with another. All of the code needs to be parsed, but it's just static text in the end.
16:19:05
mrcom
Lisp development, on the other hand, is a living, breathing thing. Typically you're right in the middle of an actively running program.
16:20:53
mrcom
Just replacing the text is theoretically more complicated. Technically, you need to handle reader macros, compiler macros, normal macros. All of which can arbitrarily modify not only the text but the state of the program.
16:21:43
White_Flame
however, these are complexities that the IDE should assist with, not just leave you to text buffer editing as it does now :-P
16:22:10
mrcom
Emacs basically throws up its hands as being too intractable a problem and just lets you change text characters.
16:24:06
mrcom
White_Flame: Yep, but a very daunting problem. I think it's been addressed piecemeal with... Emacs code.
16:25:39
jackdaniel
it is true that lisp implementations maintain various pieces of image information
16:25:44
White_Flame
I would see something like walking you through all locations of a symbol, and giving you quick access to change them to the new name vs leave it as is, if it's not a function call or #' reference to the symbol
16:26:04
jackdaniel
i.e who-calls-function and source location could be used to identify pieces of text that would need to be changed and recompiled
16:36:44
Guest74
I'd love to live in a world where a perfect programmable common lisp editor existed that could be run in your main process.
16:37:17
Guest74
meanwhile, I'm constantly reminded of the negative consequences of running my window manager in my main process.
16:39:27
Demosthenex
and i'm flattered they accepted my spatial navigation module into their contrib repo
16:40:19
Demosthenex
i'm worried about trying mu4e in emacs for email, because mutt is always up. i can't imagine also using an emacs WM.
16:42:37
Guest74
I should probably look at how stump manages errors because of nonconforming apps. asynchronous clx errors are a nuisance. I'm not sure what the experience of emacs wm users is, i think there's one of them around here somewhere.
16:44:38
_death
in fact you could try and do general Lisp development in the stumpwm process, to find out about possible issues :)
16:47:34
_death
however I need to remember to disconnect from it and connect to a new lisp process..
16:50:19
jackdaniel
that's one of a few things that lisp-based environment could help - you could adopt disconnected frames again without forsaking their state
16:50:46
Guest74
my main problem is if something crashes and emacs doesnt save changes to some buffers and i have no clue which of those buffers it is.
16:52:11
horroar
I don't think you'll get the result you want, which is certainty, without developing in a new process or VM, Guest74.
16:56:05
jackdaniel
damn, I'm getting faster with bans by minute, it is true that practice makes a champion
17:00:00
jackdaniel
well, if it becomes a bother I will probably contact someone, but next step would be banning by ip I suppose (if they didn't get that they are not welcome here)
17:47:39
jmes
If I have a list of symbols, say '(a b c) where they refer to 1 2 & 3, how do I get at those numerical values? I know I could use (list a b c) but I must access the symbols themselves and their values
17:51:11
jmes
Catie: Ah, that's exactly what I was looking for, thanks! I knew there was a function but my memory (and searching) failed me
18:00:46
pjb
jmes: (loop for name in '(a b c) collect (position name #(nil a b c))) #| --> (1 2 3) |#
18:21:27
pjb
bollu: slime is emacs lisp code. There's no package in emacs lisp, so it's hard to filter out symbols "in slime"…
18:23:41
pjb
bollu: you could do (let (l) (do-symbols (s) (when (and (<= 5 (length (symbol-name s))) (string= "slime" (subseq (symbol-name s) 0 5))) (push s l))) l)
18:24:36
pjb
bollu: now, if you think about it, you could perhaps refine your question. For example, often what one would want is a list of command in the current mode. C-h m would give you that. It may be more useful than asking silly questions.
18:31:36
_death
what's interesting is that had sbcl's apropos-list had used remove-duplicates rather than delete-duplicates, it wouldn't have lost so bad.. the latter seems optimized for space efficiency (don't cons) at the price of time complexity
18:34:06
_death
another weird thing about its definition is that it uses pushnew if a package designator is provided, again giving bad time complexity