freenode/#lisp - IRC Chatlog
Search
19:01:42
rpg
dim: It's not my other program -- it reads s-expressions -- and I can't rewrite this enormous C++ snotball to accept JSON. Plus I'd still have the "decode the symbol" problem.
19:03:22
rpg
pierpa_: Will PRINC avoid issues with *print-length*, *print-circle*, *print-level*, yadda yadda yadda?
19:04:15
rpg
actually, I don't know if it's length or right-margin that's tripping me up using format ~a
19:08:22
rpg
pierpa_: That seems to have solved my problem. So it was probably *print-length* causing my issue.
19:11:58
pierpa_
I guess you are not using weird symbol names, but in case, remember that (princ '|foo bar|) prints: foo bar
19:26:52
ecraven
how is access to displaced arrays implemented? does it always go through one additional indirection?
19:28:10
ecraven
something like get the indirection pointer once, then use that instead of going to pointer + index?
19:30:06
rpg
pierpa_: No, ok symbol names. The language I'm working with is quite restricted (and specified to be case insensitive).
19:50:46
Xof
I do have a talk to give, about use of Lisp to keep me from going insane while teaching
19:53:04
FareTower
Sorry I can't come to ELS this year :-( I hope you all have lots of fun in Marbella!
19:57:53
d3j
if anyone has a moment to spare for a newb... where can I set the paths for /includes and dll for when g++ is called in quicklisp installs... having trouble with antik / gsll install.
20:30:34
k-hos
you can set search directories with the -L flag in gcc, how you would tell quicklisp this I don't know
20:31:46
Shinmera
you also are not telling cffi, as I do not believe it handles invocation of gcc/etc.
20:38:59
rpg
Shinmera: You are right -- I think there are a number of one-off solutions to driving a C compiler, or make through ASDF, but no standardized extension for that.
20:48:46
rpg
Shinmera: Right, but I think you can set variables to influence it. How one is to do that before the creation of the package that the variable names live in is left as an exercise to the reader! ;-)
20:51:15
Shinmera
Unfortunately that often doesn't entirely do what you expect it to, since the loading of dependencies isn't done by cffi and the system probably doesn't know about the directories in that list.
20:58:38
rpg
Ah, so if CFFI asks to load library x.so in that directory, all's well, but if x depends on y.so in that directory, you lose.
20:59:04
Shinmera
Well, you might lose in a subtle way if y is on the system, but has a different version.
21:00:19
Shinmera
If you have x and y in a directory that the system does not know about and you tell cffi to load x, it'll first check that directory, see it there, then load it.
21:00:43
Shinmera
on Linux, doing so means looking in the ld.so.cache and whatever, which likely won't include that directory.
21:01:06
Shinmera
on OS X it depends on the library -- you can have library entries with explicit relative paths.
21:04:13
Shinmera
Which is part of the reason why CFFI does not advise using *foreign-library-directories* in the first place
21:05:11
Shinmera
In fact, things are such a mess that, if you want to be 100% certain things are loaded right you need to rename your libraries to unique variants that cannot be on the system otherwise, and reproduce the dependency load order yourself manually.
21:07:11
rpg
So basically, if you are using a non-system library, just make sure it contains all of its dependencies.
21:07:47
Shinmera
Well, except for things like libc, since including that will make things crash real hard
21:08:46
rpg
Shinmera: Sorry, what I really meant was "don't try to load a system that comes as multiple shared objects (unless it's installed at the OS level).
21:13:39
rpg
phoe: Was looking over your tools library and liking it. One question -- why did you make PRINT-OBJECT-READABLY be a DEFUN instead of a generic?
21:29:56
LdBeth
Common Lisp Music uses macros to generate C libraries and corresponding loading routines so foreign libraries can be loaded as if they’re compiled Lisp files
21:40:08
Shinmera
What I think is actually neat is: clx' automatically generated protocol functions based on the X spec.
21:43:24
Shinmera
Also neat: Baggers meticulously translated the GLSL spec into a machine-readable format, which is then used to generate functions in his compiler.
21:45:25
LdBeth
So maybe I can grub Intel 64 manual and auto generate instruction sets for assembler
22:00:54
LdBeth
Well it’s a little hard without an exact name. And search ARM’s ASL Specification Language gives me little results.
22:03:56
slyrus1
is there an easy way to get a type of a string -- without the length? e.g. (type-of "foo") gives me (simple-array character (3)). And I want (simple-array character *).
22:10:37
verisimilitude
If you need the particular list, (SIMPLE-ARRAY CHARACTER *), simply build it with these in, say, a backquoted expression.
22:12:09
slyrus1
I have some code that's building some cxml-stp data structures and I occasionally run into corner cases with rod/rune types, etc...
22:15:21
mfiano
(type-of "foo") gives 4 different results across 6 implementations. It's not guaranteed to give a portable result.
22:18:25
mfiano
Sure, but that's a bit out of context. However, Edi Weitz mentions in his book to not ever use it programmatically.
22:19:36
verisimilitude
Now, arrays have all of these specialized functions for dealing with them, but that's not a good reason to disregard TYPE-OF.
22:25:10
aeth
Well... a typed cons is still necessary, so you can tell just by type checking the car the type of every element in a list
22:25:44
aeth
I don't think you can do that with the existing cons, since a cons could hold anything
22:26:37
pierpa_
you can declare a variable to hold a (cons integer list) then it's your responsibility to ensure this is true
22:27:35
aeth
Or you could have a struct called kons where kar is of type foo (e.g. fixnum or integer) and kons is of type (or kons null)
22:28:30
aeth
Unfortunately, implementations are wildly inconsistent on struct type checking. Afaik, SBCL always checks, but one of CCL or ECL only checks in the constructor and one only checks in the setter.
22:31:26
pierpa_
the following is not working (deftype integer-list () '(cons integer integer-list)) /me wonders why...
22:31:57
aeth
pierpa_: That wouldn't be a good idea, though. That would be O(n) checking if it worked.
22:33:32
aeth
And if it's a struct, SBCL and possibly others will efficiently allocate the typed cons where it's possible, e.g. the double-float members will be unboxed.
22:36:39
verisimilitude
I never bothered to look, but I'd figured a CONS would usually be implemented identically, regardless of type, even in SBCL.
22:46:56
aeth
Of course, you would have to override the accessors and constructor on an implementation-specific basis to get the desired behavior, inserting check-type's and the's where needed
22:47:36
aeth
You'd also probably want to write a typed-list as well as some list related operations, such as do-typed-list
22:48:58
aeth
I'm probably going to use a variation of that in one of my programs because it turns O(n) type checking into O(1), and there isn't much more than type checking done to items of the list.
22:52:46
aeth
The accessors are wrong, too. Atm they're fixnum-cons-fixnum-car, but that's just a simple (:conc-name nil)
23:20:51
rpg
phoe: I think so. On my way out of the office right now. I'll try to remember to do that when I get home.
23:21:59
phoe
minion: memo for rpg: could you submit an issue with a proposal for making that function generic?
0:11:52
minion
rpg, memo from phoe: could you submit an issue with a proposal for making that function generic?
2:03:13
slyrus1
I'm still thinking about this closure-common rune thing and trying to figure out a good approach.
2:03:43
slyrus1
The problem is that the assumptions about rods/runes don't seem to be (always) true in current SBCL.
5:09:05
White_Flame
is there any name or notion for currying that can happen in any order? it always seems difficult to me to use currying, because it's not guaranteed which of the parameters I'd want to predefine
5:35:29
theemacsshibe[m]
ACTION sent a long message: theemacsshibe[m]_2018-04-13_05:35:29.txt <https://matrix.org/_matrix/media/v1/download/matrix.org/tbWgwDVOXjtwtfcslaGQxbDS>
5:42:01
White_Flame
I mean, given (lambda (a b c) ..), maybe you want to set b first, then c, then a, or whatever, as separate steps
5:42:23
White_Flame
but yeah, if you (lambda (b c a) (funcall thing a b c)), then you can curry the outer per ordering you want I guess
5:43:26
phoe
because then a programmer will know that the order in which you bind these variables matters
5:43:54
White_Flame
"setting" as in holding on to a partially applied function, except choosing which parameter to apply first
6:13:21
johnnymacs
So what confuses me about lambda calculus is that everything in the program is stored inside of a single function all of the time
6:14:01
johnnymacs
So if the current function is a list it can't really do anything else to be a list
6:14:18
johnnymacs
I need some combinators that will help me actually store multiple things at once and reference them