freenode/#lisp - IRC Chatlog
Search
16:43:03
zmagii
beach: I have file.lisp opened in Emacs, it shows SLIME in the status bar. How can I run the code?
16:45:45
beach
So you can do (load "file.lisp") and then evaluate calls to functions defined in the file.
17:02:24
dbotton
Is it valid in a let* to rebind same symbol multiple times, ie (let* ((a 5) (a 4))) ?/
17:06:18
dbotton
So if I create a CLOS object then rebind the variable it will persist till end of scope
17:07:55
pranavats
A let* is equivalent to nested lambdas with variable names as an argument and applied to their values.
17:09:41
deselby
OpusModus Convention, second day streaming now! https://www.youtube.com/watch?v=2wqU8Ki622M
17:10:20
pranavats
dbotton: Where ... represents the body. So yes, a would still be bound to 5 in the outer lambda.
17:22:07
beach
dbotton: That's not clear. If the first binding is never used, the compiler can remove it, and then the GC can reclaim the object.
17:25:02
pranavats
dbotton: Then maybe it's preferable to just use nested let forms and make sure to use the shadowed binding in the outer let.
17:26:31
Alfr_
dbotton, why do you not want that thing to be collected in the first place? It's quite an unusual ask, if you ask me.
17:26:45
dbotton
Here is code snip - https://github.com/rabbibotton/clog/blob/main/tutorial/09-tutorial.lisp
17:33:12
Alfr_
dbotton, your (create-form-element f1 :submit :value "OK") might get collected, like beach said.
17:38:05
dbotton
The actual Lisp side after creating the elements on the browser side are not needed. In fact unless I actually need to set a property or event or need request a property value the Lisp side no longer matters
17:38:39
nwoob
mfiano: I commented out loading of theme in .emacs and now without theme syntax highlighting loooks like this https://ibb.co/nsHt6SV
17:40:32
Alfr_
dbotton, you may wish to have a look at LTK's with-widget macro. I think it deals with the same problem for using tcl/tk.
17:45:15
beach
"standard object" is what you typically get when you instantiate a class defined using DEFCLASS.
17:57:56
shka_
but thing with CL (or any other lisp, really) is that there is barely a syntax to highlight
17:58:13
charles`
rainbow delimiters (not default faces) greatly enhance syntax highlighting for lisp
18:00:33
charles`
the problem with highlighting builtin functions is the almost everything becomes highlighted. there is nothing to differentiate, builtin macros like loop, if, and let should be highlighted
18:01:29
shka_
after years of programming i just accepted that I am getting information overload way quicker then i would like to admit
18:12:13
nwoob
shka_: so if I want to look for documentation of a particular buitin function how do i do that inside emacs?
18:16:44
scymtym
SLIME has C-c C-d h for looking up symbols in the specification. more generally, C-c C-d KEY looks up different things in the specification
18:17:52
scymtym
shka_: McCLIM got *support for icons*. your are probably just seeing the default one
18:22:25
scymtym
shka_: based on https://techfak.de/~jmoringe/presentation-clouseau/slides.html#/slide-slide%3Anames
18:28:00
charles`
it seems that basically you want all functions to be colored, and all non function symbols to be colored a different color
18:32:39
charles`
I believe that is what you are going to need. You will need regexes to identifiy all macro forms where you can define variable, let, destructuring bind, multiple value bind, loop and select variable names, then a regex to select function names, maybe also in flet and labels
18:35:04
charles`
You can use M-x regex-builder to test the regex since emacs-lisp regex is not pcre
20:33:48
xificurC
Reading the iterate docs I hit into this: "There is one crucial difference between using a the form and actually declaring the variable: explicit declarations are always placed in the generated code, but type information from a the form is not turned into an actual declaration unless you tell iterate to do so using iterate:declare-variables". What
20:43:14
Alfr_
xificurC, (iter (for (the fixnum i) :below 7)) would not expand to something declaring i to be a fixnum, whereas (iter (for (the fixnum i) :below 7) (declare (iterate:declare-variables))) would.
20:47:09
Alfr_
xificurC, but in iterate's case the iterate macro walks its body forms and in some places treats the THEs specially, mainly providing appropriate initial values instead of nil and declaring the types.
20:47:53
xificurC
Alfr_ yes I read that but didn't completely grok it. Re-reading the fourth time it seems to suggest it is merely a type-check, but if the type doesn't match the consequences are undefined
20:52:04
Alfr_
xificurC, the special operator is more like a promise to the compiler that what form returns is of that type. I don't think there's a requirement to type check. And yes, it's ub when you break your promises.
20:52:33
aeth
xificurC: afaik, in general, THE counts as a type declaration of sorts and so should behave similarly to DECLARE. It will check, ignore, or assume the type. Only the last one is problematic.
20:53:43
aeth
(I mean, it's entirely UB, but those are the only three possibilities you'll see in practice)
20:53:50
xificurC
Alfr_ OK, if it's a promise to the compiler, how is that different from a declaration? Is there a runtime difference you can tell/show me?
20:56:24
aeth
Usually, you'd use THE in place of DECLARE if you don't want to have to name it as a variable first, e.g. (the fixnum 42) but the example of the (the fixnum i) is declaring a new binding rather than using the value of i.
20:56:27
Alfr_
aeth, and specifying the initial binding for the variable to be of the appropriate type.
20:57:02
xificurC
the docs say there's a *crucial* difference, which seems to suggest I'm missing something. Also, if there isn't any difference, why does `iterate:declare-variables` exist?
20:58:35
aeth
I don't like how any advanced usage of LOOP is going to be indented poorly because it's not s-expression-based (even with the SLIME extensions... try to do a complicated nested conditional), but, wow, iterate makes mistakes that come up in #lisp all of the time
21:02:20
xificurC
also, I'm still not sure why does `iterate:declare-variables` exist if you claim there's no difference to `the` and `declare`
21:04:52
Alfr_
xificurC, shorter hand I think and the THEs only take effect if declare-variables is declared.
21:17:10
saturn2
THE only promises what the type will be at the moment a particular form is evaluated, DECLARE promises a variable will always have a particular type where the declaration is in scope
22:58:58
fiddlerwoaroof
I vaguely remember someone talking about loading every system distributed with Quicklisp into a single image as a sanity check of sorts
23:31:18
fiddlerwoaroof
Xach: makes sense, I'd be interested in a "stable" dist that only accepts pure lisp packages (no FFI) that can be loaded together
23:32:20
fiddlerwoaroof
I've occasionally tried to figure out how to host my own diet, for reasons, but never really seriously enough to have anything to show
23:33:26
Xach
fiddlerwoaroof: i had hoped that dists would be very common, with people hosting lispworks-only software, or other thematic dists, but a combination between a lack of interest and a lack of documentation and probably other factors has made it not happen yet
23:45:53
charles`
I would think if you were a company writing internal libraries you would want to host your own dist for those.
23:48:34
aeth
fiddlerwoaroof: there is a distinction... outside of systems with X Windows (where CLX exists and can use the protocol), you can't do anything graphical without some degree of FFI
23:49:01
aeth
But if someone made a graphical toolkit on top of just the OSes themselves, then it would be useful.
23:51:12
aeth
Xach: Sorry, I'm unclear, I mean zero distributed foreign dependencies. So if someone wants to just wrap the WinAPI, then that should be OK, to complement something like CLX, but OS-agnostic.
23:51:51
aeth
As opposed to something like cl-sdl2 where you have to have SDL2, a giant C dependency, at some point.
23:52:51
Xach
Oh. Well, I'm thinking of users with semi-exotic platforms, where binding to some "it's installed everywhere! (if you use linux/windows/macos)" is a failure