freenode/#lisp - IRC Chatlog
Search
10:30:44
_death
Xach: since you mentioned tic-80, check out my fork https://github.com/death/TIC-80 ;)
13:14:46
TMA
It is related to vector space dimension ... n-tuples of (real) numbers make a vector space of dimension n
13:15:38
beach
Not quite. If you compare to Common Lisp arrays, then the number of dimensions is called the rank.
13:20:31
TMA
rank is a higher level concept. a matrix is has rank 2, because it is a m-tuple of n-tuples, with tensors having even higher ranks; in Common Lisp a vector is a tuple (and vice versa) and a vector has rank one regardles of the dimension thereof
13:22:38
_berke_
hi guys, I get a "This is probably a bug in SBCL itself." from maxima under imaxima, see https://pastebin.com/p7n7BSa2 - any tips?
13:27:12
pfdietz
If errors are not caught in SBCL, a stack trace gets printed showing where the error was signalled.
13:28:06
pfdietz
The other thing to do is find the function it could not compile and prune off as much of it as you can while still getting the error. Put a copy of it into its own file and edit that down.
13:28:25
_berke_
I setf'd *debugger-hook* to nil, now I'm in the debugger. can I request a bt from there?
13:29:46
pfdietz
Then submit a bug at https://launchpad.net/sbcl or send it to sbcl-bugs@lists.sourceforge.net
13:30:17
_berke_
thanks, the thing is when I run maxima from the shell (ie not under imaxima from emacs) it works fine.
13:31:20
pfdietz
Not sure why you're not getting the stack track. Try aborting to the top level REPL and manually loading that file with (load "/usr/local/share/maxima/5.41.0/share/pdiff/pdiff.lisp")
13:33:48
pfdietz
If you put that function in its own file, be sure to include a (in-package ...) form so it's read in the correct package.
13:35:06
pfdietz
I assume this is the official source: https://sourceforge.net/p/maxima/code/ci/master/tree/INSTALL
13:39:44
_berke_
is cat foo.lisp bar.lisp >baz.lisp and then (load "baz.lisp") equivalent to (load "foo.lisp") (load "bar.lisp") ?
13:40:33
jmercouris
also you generally want to avoid manually loading lisp files, instead you should use a system
13:40:52
jmercouris
so the de-facto system is "ASDF" which stands for "another system definition facility"
13:40:54
_berke_
jmercouris: I understand but I'm chasing a bug that involves two files, is there a way to place them in a single file for an easier-to-use bug case?
13:41:33
jmercouris
_berke_: it will not be the same thing, but you might try what you are suggesting, and the bug might still appear
13:41:41
Bike
that's a pretty primitive way to do things, but i don't see why the concatenated file would be much different
13:45:06
_berke_
I hope so. how can I check if any native code (e.g. shared libraries compiled from unsafe languages) were loaded?
13:48:11
pjb
ukari: "AS" is the name of a package (probably a short nickname actually). quickload loads systems. It expects a system name, not a package name.
13:49:38
pjb
ukari: also, not all systems are on quicklisp, and not all packages are defined in systems.
13:51:36
pjb
ukari: so you have 1- locate the name of the system where this package is defined. Then you may try quickload on it. If it doesn't work: 2- locate the source of that system (perhaps a git repository, perhaps a tarball somewhere). Then you can clone it or untar it in ~/quicklisp/local-projects/ and try quickload again. If not a system, then locate the sources, download them, and either use a load script provided to compile and lo
13:52:01
pjb
Be sure to contribute the asd system if you write it, so it may eventually be integrated in quicklisp.
13:55:41
_berke_
it seems to be the combination of that style-warning-suppressor macro and the memq definition
13:56:57
_berke_
transcript: https://pastebin.com/92cSATWH - thanks for your help, gotta earn some money now
14:17:34
light2yellow
I was reading LISP 1.5 manual, appendix H ( https://books.google.com/books?id=68j6lEJjMQwC&pg=PA91 ) talks about recursion implementation. is this the first occurrence of a programming language implementing recursive functions? from what I can understand, it doesn't differ much from call stacks we have now
14:21:48
Bike
quick google suggests turing described it with return addresses https://www.quora.com/Who-invented-the-call-stack
14:22:07
Bike
i think i've heard lisp was the first thing with a stack with local variables, but i dunno
14:32:18
light2yellow
right, so, a paper called "A brief history of stack" says that IPL had the stack, but "its usage had to be explicitly described when a subroutine was called". McCarthy made it being handled automatically. at this point the paper references his "History of LISP" which says a few sentences about SAVE and UNSAVE, on which the manual elaborates
14:39:34
equwal
Hello, I have a question: Is ther a way to have a generic function with polyarity without hand-writing dispatching code? I want to have a function like (x 1) do something, while (x 1 1) does something else. Defgeneric doesn't really seem to do the job. I was able to hand-write some dispatching code, but I feel like this is already a feature somewhere that I am not aware of.
14:40:39
Xach
equwal: no, it is a feature not to have variable arity. the name and argument count & names are the interface. if the argument count & names are different, it must be a new function with different behavior.
14:41:19
Xach
equwal: i can imagine some ways you might reach your desire - what is your specific circumstance?
14:42:45
equwal
My ad-hoc way of doing this was to define a hash table with (make-hash-table :test #'equalp) which is searched for by a list of the function name and the arguments, like (gethash (list func spec-list)). I used some macros to abstract this away a bit.
14:43:14
Xach
equwal: i mean, why do you want what you want? what is the operation you want to perform on a variable number of arguments?
14:43:38
equwal
I can't use &optional in this case either. My circumstance is I want apl functions like RHO ⍴ to accept one argument (⍴ 2) which is an empty array, or (⍴ 2 2) which is the array #(2 2) for example.
14:43:58
tfb
equwal: a terrible solution I used was to write a wrapper which has an &rest arg, which calls into an implementation GF passing the length of the &rest arg as the first argument which is dispatched on with eql methods.
15:01:59
Xach
Hmm, I don't think I've seen this error in SBCL before: "<variable> is read-only in this environment"
15:28:16
ealfonso
is there a good way to turn an alist into the arguments of a function whose argument list only defines a proper subset of the alist keys as &key arguments, without writing a macro myself? e.g alist: ((:var1 val1) (:var2 val2) (:var3 val3)) function: (defun my-fun (&rest args &key var1 var2) ...)
15:34:24
beach
I.e. (apply #'my-fun (list* :allow-other-keys t (reduce #'append alist :from-end t)))
15:36:06
pfdietz2
Failed AVER in the sbcl compiler is always a sbcl bug, even if the user code is bad.
15:44:52
ealfonso
beach how about binding only unknown keys instead of all keys? I'm using (progn (defun my-fun (&rest args &key var1 var2 &allow-other-keys) ...) (my-fun :var1 1 :var3 3)) but this binds all args. I guess I would need to do this myself?
15:47:36
ealfonso
beach I see, you meant I could add :allow-other-keys t from the caller, which I didn't know about. but I had forgotten about &allow-other-keys, which I can use since I'm defining the function
15:51:35
beach
Then, instead of &rest args, why don't you just build the list of the explicit keyword parameters, i.e. (list :var1 val1 var2 val2).
15:53:32
ealfonso
beach I'm basically trying to extract a command-line argument list, by cherry picking some and handling them in functoin A, then proxy all other arguments to another function B. this way, if I add more arguments to function B, I can simply pass them from the command line without the overhead of defining it explictly as a keyword argument in A
15:55:57
ealfonso
beach but function B will crash if it gets unexpected keyword arguments... I guess I can just add :allow-other-keys t to the call to B
17:43:21
_berke_
how can I get a summary description of what a system is in quicklisp? ql:system-apropos gives a list but only with the names
17:43:39
Xach
_berke_: Unfortunately there isn't a good way right now, aside from googling the name and "lisp"
17:44:48
_berke_
thanks. any recommendations for a system providing a set data structure? (eg tree-based)
17:50:39
ukari
is there any way to detect if a expersion is in a lambda-list when it comes from defmacro's form?
18:17:48
shka
just functional vector (radix tree), functional dictionary (hamt) and metric space set (egnat)
18:18:03
jsjolen`
Hi, just out of curiosity: Why can't SBCL compile (let ((x 0)) (dotimes (i 1000) (incf x))) this down to (setf x 1000) (off-by-1 mistakes excluded)?
18:22:18
MichaelRaskin
If you need that optimisation, maybe you should use Maxima first to simplify your calculations, then write Lisp code for SBCL…
18:23:27
shka
jsjolen`: honestly though, code for that needs to be maintained and feature does not look whole lot useful
18:24:00
White_Flame
well, you never know what macros might generate in terms of degenerately collapsable code
18:24:20
jsjolen`
I don't need it, I'm just legit curious as to why it doesn't do that. Whether it's because it's actually deviously difficult to solve for the general case (heck, what would the general case be tehre?) for all languages or for CL in particular
18:25:50
MichaelRaskin
Well, if you have macros known to generate arithmetic expressions, feeding the output to Maxima is feasible… Maintaining a computer algebra system inside compiler sounds like a duplication of work.
18:28:45
jsjolen`
Sure. Also, if you do think of it as 'that formula' then it's easy to see that it's a bit silly to implement that specific kind of optimization in the compiler, it'd be more apt to fit it into a sum-function along with compiler macros (for example)
18:30:53
Bike
intuitively i'd say it's rare for people to write code like "do this n times" if it could be "do this once, n times as much"
18:32:04
White_Flame
the difficulty in this particular case is proving the scope of the variable being mutated, as being fully owned by the loop
18:32:37
White_Flame
as well has knowing which operations have which side effects, and being able to execute them safely at compile-time
18:32:50
aeth
Bike: But the more optimizations the compiler has, the more people's idiomatic styles can change.
18:33:19
aeth
e.g. if you're writing very fast CL, you're probably only going to use type declarations for sequences and numbers because the type inference is probably going to solve the rest.
18:33:34
aeth
But if the compiler didn't do any of that you'd say that idiomatic high-performance CL types everything
18:46:25
aeth
MichaelRaskin: but then someone would have to update the size and type of a field in an old COBOL or mainframe assembly program from the 1980s or earlier.
18:47:19
MichaelRaskin
aeth: 6-digit PINs in 1980s? What were they used for? I thought card PINs are 4-digit (for physical presence case)
18:58:49
MichaelRaskin
So, did the talk launch a new round of «how many turing complete facilities does CL have»?
18:59:22
Xof
(b) a chance to use my pet favourite feature: dynamically scoped named-by-symbol functions
19:01:24
Xof
are the restarts still active while executing the body of the restart function, I wonder?
19:13:17
pjb
method-qualifiers is a symbol exported by CL! There's no need to make this code SBCL-specific!
19:15:36
Bike
method-qualifiers and function-keywords are the functions where you're like, why is this in cl instead of mop
19:18:40
Bike
also, (restart-case (find-restart 'x) (x ())) => "Unhandled memory fault" in sbcl, that's nice
19:28:04
Bike
you don't need state to be shared either, so just `(restart-bind ... (lambda () (let ((state (call-method ...)))...))
20:09:24
White_Flame
a register had 2 fields it could be broken up into, the "address" part, and "decrement" part
20:44:38
phoe
is this a method combination that sets state based on method calls and then uses restarts to find its next state?
20:46:39
rme
"First – and understand this, Harry, 'cause it's very important – not all wizards are good."
20:49:49
jasom
I happen to like cooperatively scheduled lightweight threads as a programming model, so the lack of them (or continuations which are nearly isomorphic to that) in CL has always bothered me a bit. cl-cont works, but code walkers tend to bitrot.