freenode/lisp - IRC Chatlog
Search
22:51:10
phoe
https://github.com/ruricolist/serapeum/blob/cd82e23548e79038233c3ac7b165edc83ba22d69/packages.lisp#L3 I see.
22:58:56
phoe
There was some ASDF option that specified the relative pathname under which all source files are available. What was that?
22:59:19
phoe
Say, I have /foo/foo.asd and /foo/src/bar.lisp - I want to have a component (:file "bar") for it.
23:17:06
phoe
I'm becoming a better lisper every day - I've never used this ASDF option until today, even though I've created multiple systems that have their files separated like that
23:38:34
pjb
phoe: (subseq (com.informatimago.common-lisp.cesarum.package:package-exports :cl) 0 10) #| --> (fboundp some end-of-file caadr *read-eval* member symbol-function array-element-type terpri nil) |#
2:09:01
jmercouris
I have (flet ((func (x) (print x))) (mapcar func listz)) and it complains that func is unused
2:10:05
jmercouris
why is it sometimes to only quote a symbol rather than using the explicit function notation
2:14:35
didi
jmercouris: Others can explain it in more details, but FLET dines local named functions. By calling (mapcar 'func listz), you're passing a function designator, not the function.
2:15:17
didi
"The names of functions defined by flet are in the lexical environment; they retain their local definitions only within the body of flet."
2:16:10
jmercouris
so (quote func) is only a symbol that designates a ffunction rather than #' which somehow explicitly notes a function
2:19:32
White_Flame
since FUNCALL and APPLY accept function designators, anything that falls through to that implicitly supports them
2:21:20
White_Flame
in your original question, mapcar can't see the lexical binding of FUNC, and nothing you pass to it links to it
2:21:32
didi
jmercouris: I learned to use #' after a COMPLEMENT failed with a symbol deep inside my program.
2:25:08
didi
jmercouris: Read chapter 3. Scope and Extent. It will do a better job than I will ever be able to.
2:34:09
White_Flame
jmercouris: did you also get an error about FUNC being unbound when you're passing it into mapcar?
2:34:45
White_Flame
so you're just passing a symbol. Mapcar can't see anything about that symbol besides its toplevel symbol-value, symbol-function etc
2:37:06
jmercouris
my peak has been around 180, and I can average 100-120 for sustained periods of time
2:45:26
pjb
(flet ((fun-fbound-to-fun (x) (print x))) (mapcar (function fun-fbound-to-fun) '(1 2 3)))
2:47:17
PuercoPope
There is an advantage to using the symbol instead of the function itself. Because the symbol is looked up when the code is run if you redefine the function you'll get the new function instead of keeping a reference to the old function object until you recompile the call sites as well
4:33:46
didi
Uh. Evil http://www.nhplace.com/kent/Papers/Technical-Issues.html gave me the idea for https://paste.debian.net/hidden/62100c7d . Evil.
4:44:36
didi
gilberth: Scheme doesn't have this issue? http://www.nhplace.com/kent/Papers/Technical-Issues.html says it can happen with Lisp_1 too.
4:45:18
gilberth
didi: Don't ask me. I just was kidding, because Schemers think our macro system is dirty.
4:48:50
gilberth
didi: Perhaps it can, I tried to be funny in a way. Though I don't remember much Scheme. I love my dozen namespaces.
4:52:02
didi
gilberth: Nope. I tried reading CLtL2, but this stuff is hard. I guess I'll stay with (defmacro mfn (x) (fn ,x)) for now.
4:53:12
gilberth
didi: OK, if that works for you, the better. But dig the different evaluation times when you have time for that.
4:58:50
PuercoPope
is there any reason to prefer ash vs dpb/ldb when 'buidling' integers from octets? Most code I've found in the open uses ash but I'm inclined to think it is more a more a consquence of familiarity with C
5:00:47
gilberth
And here is why: The exact "subsequence" of bits named the byte is explicitly mentioned in the involving BYTE.
5:13:26
PuercoPope
its also more 'clear'. "I want to put this bytes here" instead of add this number and move them to the right X times
5:14:08
PuercoPope
I was surprised to learn that ldb only works on integeres. Is there a reason why it couldn't work on floats?
5:15:42
gilberth
You also could do, say, (DEFCONSTANT +OPCODE-BYTE+ (BYTE 4 28)) and later just (LDB +OPCODE-BYTE+ X)
5:23:36
gilberth
To answer the original question: Yes, I believe DPB/LDB is "cleaner", but people are just used to ASH/LOGAND/LOGIOR because of C idioms.
5:27:08
gilberth
You were asking, why it wouldn't work on floats. So imagine it would, what would happen?
5:30:05
gilberth
ANSI CL specifically does not stick to any particular float encoding. Even decimal floats are possible. See INTEGER-DECODE-FLOAT or what ever that is called.
5:35:37
PuercoPope
I as unware there were different encoding to floats, in that case it doesn't make sense for ldb to work on floats.
5:36:58
gilberth
Did you imagine for LDB and DPB to work on the underlying bit pattern? Instead of the mathematical value?
5:38:39
gilberth
As in: I have a double --- that are 64 bits --- here and there is the exponent and there is the sign?
5:43:59
gilberth
And then the IEEE format is nuts anyway, I hope we replace it by something more reasonable.
5:48:31
PuercoPope
gilberth: yeah, like single-float had only one representation. But if it is like chars, it is a good idea to not leak the concrete encoding into the rest of the language
5:49:40
gilberth
PuercoPope: Correct. That way to extend the character datatype to 29-bit code points didn't hurt.
5:51:48
gilberth
So, when we make contact to aliens, which have their own 40-bit character set, we could easily extend the character data type with no damage done. :-)
5:54:08
gilberth
Actually I love that. We run code, which is 30 years old or older. And it'll still run in 30 years.
6:00:03
PuercoPope
One problem with old code is loading it. Not all old code used mkdefsystem which translates more or less to ASDF. For example loading op5 in SBCL is not straighforward. But I agree its nice for code not to bitrot
6:01:31
gilberth
Well, that is loading "only". Look at CXML for example. I started to write that some 20 years ago and people still use that. Though I have no idea who maintains it right now.
6:05:59
gilberth
There is still older code out there. I still use lalr.lisp from 1988, initially written by Mark Johnson.
6:07:37
gilberth
Point is: I love that Common Lisp is machine independent. In C an "int" is something different everywhere.
6:10:39
gilberth
That once was a straight 72 hour session to convert from some strange typesetting system to SGML and generating HTML.
6:13:50
PuercoPope
I haven't bothered to learn texinfo and now that you can generate info manuals from Org mode I don't think I'll ever will. Its a pitty because modern documentation tools pays little attention to things like indexes
6:16:36
PuercoPope
It helps w/ autocomplete at the very least. But having indexes is a prerequiste to having proper search
6:17:56
gilberth
What I find more important is the term/concept idea. We have that in the CLIM spec. It says, say, "The argument x must be a foo."
10:01:26
feynhat
I am trying to use this library called "kenzo", which I have installed via quicklisp.
10:03:10
White_Flame
in the SLIME repl, kenzo:<TAB> to see what autocompletes is a good starting point to read
10:10:39
feynhat
phoe, was it really necessary though? I am sure people who are familiar with lisp would have figured this out quickly.