freenode/#lisp - IRC Chatlog
Search
14:15:42
jjkola
my quicklisp update became partially borked and now some of the package are still using the old version even though the latest is available and installed
14:17:57
jjkola
when I connect to slime it says the version is 2.20, and also when I connect to other instance where the dists version is latest, slime complains that swank is 2.23 while the currently used is 2.20
14:23:10
jjkola
the reason it became borked was because when updating it complained that ubiquitous could not be found
14:25:29
Xach
jjkola: it seems to me like emacs is loading an old slime through some other means. where does emacs think the function slime-connect is defined?
14:26:33
Xach
Then you will be in slime.el and can check the path to the file with C-x C-f for example
14:27:01
polezaivsani
Hi! Does anybody have tips on what reference (or else) material is good for getting up to speed with subj for somebody having a basic grasp of scheme? I'm thinking to scratch an itch with sbcl planning to learn as i go/fall.
14:27:43
Xach
polezaivsani: first, forget everything you know about scheme when trying to learn how to use CL and SBCL effectively. second, there are many good books on the topic. i like practical common lisp and paradigms of ai programming.
14:27:53
polezaivsani
Bike, thanks i know that. i mentioned scheme to let you know that i have some relevant exp
14:28:15
Xach
i found scheme experience to be harmful rather than helpful, but your experience may vary
14:28:19
Bike
i don't think you have to forget _everything_, but it's definitely a distinct language
14:30:19
Xach
jjkola: hmm! the swank.txt file should point quicklisp-slime-helper to the 2.23 version. i don't know why it is not.
14:31:01
polezaivsani
Oh, i didn't thought of scm experience to pose an issue - i'll keep an eye out for it!
14:33:50
Bike
in lisp the same symbol can name multiple different objects in the same scope, unlike in scheme
14:35:09
polezaivsani
i too worry mostly about recursion, namespaces doesn't seem that big of a deal to me
14:37:15
polezaivsani
thanks for the hints fellows! i heard good praises about PCL and will prob stick with it for now
14:38:00
Bike
the tail recursion thing does imply actual restructuring of program logic more, though.
14:50:33
jackdaniel
when I buffer unfinished lines (from stream-write-string which has a string, start and end parameters) what would be better: storing (list string start end) in internal collection or maybe rather copying the appropriate part of the string to an internal "buffer" string?
14:53:47
jackdaniel
the first approach seems dumb, but otoh it avoids unnecessary copying so it might actually pay off...
14:54:29
jackdaniel
good point, thank you. also when I spoke it aloud I now think I'm in a microptimization tarpit (in a passage which is not a bottleneck)
14:55:08
shka_
jackdaniel: i actually suspect that for short strings copying may be even faster and require less memory
15:15:33
jcowan
I think in practice there is only one implementation that does not do tail recursion, and a few more that don't do arbitrary tail calling. However, it's not CL style to depend on this.
15:17:40
jcowan
One problem with storing "fat pointers" into strings is memory leaks: if you read a 1 MB string from a file and then save a "fat pointer" to just five characters of it, the rest of the 1 MB is basically a memory leak
15:18:42
lieven
jcowan: yes, but things like unwind-protect and similar even in macros may make code that looks tail calling not actually be tail calling
15:19:54
lieven
it took the Scheme people some 20 odd years to correctly define what is meant by tail calls so it's a rather hard problem
15:20:14
jcowan
(I must say that I did not find my knowledge of CL to pose a difficulty in learning Scheme. Although if CL had been my first language, or even my first Lisp, things would probably have been otherwise.)
15:21:51
lieven
the main problem is some people insisting in writing one language in the syntax of another language instead of using a language idiomatically
15:31:02
gendl
i think i can get the seed donors to go along, if we think it will help get closer to the matching target..
16:52:30
glv
Hi. Does anyone know if there is an example somewhere showing how to make a text-field gadget act as a password field in a McCLIM GUI (showing '*' instead of characters)?
17:04:03
djeis[m]
glv: You might have better luck asking that question on #clim, although I'm not entirely sure that the text field gadget supports that kind of operation given only the CLIM 2 specification.
18:02:22
glv
ThomasLewis: Thanks. I saw a similar piece of code in the CLIM 2 user guide, but I have not yet managed to make it have any effect on my text-field gadget.
18:54:51
jackdaniel
for the record: I've explored alternative approach which lead to a bug report: https://github.com/McCLIM/McCLIM/issues/726
19:14:46
ThomasLewis[m]
glv: (setf password (accept 'password :stream query-io :prompt "Password:" :query-identifier 'password))
19:34:03
pfdietz_
jcowan: I don't think there's a need to preserve the entirety of an array if something is displaced into it.
19:35:23
pfdietz_
Referencing your earlier comment: "One problem with storing "fat pointers" into strings is memory leaks: if you read a 1 MB string from a file and then save a "fat pointer" to just five characters of it, the rest of the 1 MB is basically a memory leak"
19:37:15
pfdietz_
The CL displacement mechanism for arrays is essentially an immutable offset into a subsection of another array. A sufficiently smart garbage collector could free up the parts of the target array that are no longer reachable.
20:48:49
pjb
But the point is that you map the keycodes to keysyms with xmodmap, and there's no windows keysym.
20:50:14
pjb
emacs uses C- M- and S- and combinations. So we're free to do whatever we want with choards including s- H- and A-.
20:50:58
didi
Idea: In REDUCE, if I say `:FROM-END t', then :START means end and :END means start. Why? Because then I can say `:FROM-END t :START 1' to avoid the last element and not have to say `:FROM-END t :END (1- (length seq))'.
20:51:38
pjb
didi: NOPE. (reduce (function list) "abcdefgh" :start 1 :end 3 :from-end t) #| --> (#\b #\c) |#
21:11:22
comborico1611
So if I run a compiled file in a REPL, it is pretty consistent with how the program would run outside of a REPL? -- specifically concerning the order of defining variables and functions.
21:12:28
comborico1611
The context I'm discussing is pretty expressed here: "REPLs tend to work a little differently, because they are usually used interactively, so don't take their warnings as good normal practice. I'm not familiar with your REPL, but most of them have a paste mode or a compile mode that will work more like a regular compile environment."
21:13:20
Grue`
if it's not a fresh REPL, the previously executed code might affect the newly loaded code
21:22:01
comborico1611
Anyone have recommendations for an article on the subject of order of definitions in Lisp?
21:23:37
comborico1611
In the sense how Lisp differs from most programming languages in that you can't call a function before you define it. (I think -- I'm pretty confused.)
21:24:36
fiddlerwoaroof
? the compiler will complain if a function hasn't been defined yet, but as long as you define the function before your code executes, it should work
21:25:02
fiddlerwoaroof
It gets complicated when you try to use a macro in the same file as its definition
21:25:22
fiddlerwoaroof
Because, the functions a macro calls have to be defined when the macro is expanded.
21:27:18
comborico1611
fiddlerwoaroof: Hmm. What about if defining a paramater which contains a structure defined lower in code?
21:27:34
Grue`
ok, this is dumb. If I use package.lisp to define all my packages, I can't use :import-from to import from a package defined in the same file, because the symbol doesn't exist in the target package because package.lisp is the first file to be loaded
21:30:36
fiddlerwoaroof
Grue`: is the symbol you're trying to import exported from the other package?
21:30:54
fiddlerwoaroof
If it is, it works, otherwise I think you have to refer to it at least once to intern it
21:32:18
fiddlerwoaroof
Well, it depends. I don't like :use, so I'll import-from if I want to avoid typing out the package name
21:35:20
pfdietz_
"Note that top level forms are processed in the order in which they textually appear in the file and that each top level form read by the compiler is processed before the next is read."
21:35:52
pfdietz_
So if you put a DEFPACKAGE form at the top level in a file, that package is available to the reader in reading subsequent forms.
21:36:58
pfdietz_
A somewhat common approach is to put a defpackage at the top of each file, unique for that file. Properly structured, these can be used to infer dependencies between files ("package inferred system").
21:49:40
fiddlerwoaroof
I like using packages to group things "logically" so I don't have to think about the file-structure as much
21:53:20
jasom
uiop:define-package also has some things that are useful for this style: https://github.com/fare/asdf/blob/master/uiop/package.lisp#L712-L733
21:56:47
pfdietz_
I am old school and put defpackages and defmacros off in their own files, to live with lisps that didn't implement things right. I think those have mostly been fixed or died off, though.
21:58:33
didi
pfdietz_: Macros and structs are challenging. Ideally they are defined first, but that means putting them away from where they logically belong, along with their auxiliary functions.
22:19:02
fiddlerwoaroof
I usually define a macro like DEFUN-CT that wraps DEFUN with an appropriate EVAL-WHEN
22:48:38
pfdietz_
The DEF- forms in CL should not need EVAL-WHENs, if the implementation is conforming.
22:50:34
gilberth
pfdietz_: Auxiliary functions to macros still need EVAL-WHEN as fiddlerwoaroof pointed out already.