freenode/#lisp - IRC Chatlog
Search
13:05:41
phoe
Make sure that the symbol you use in the SLOT-VALUE and the symbol used as the slot name are EQ.
13:06:38
phoe
francogrex: https://stackoverflow.com/questions/40742048/is-there-a-way-to-get-the-slots-of-a-class
13:13:16
random-nick
is there a pastebin service which does rainbow parentheses or parentheses highlighting?
13:17:08
jackdaniel
most do. one created by Shinmera has also CL-specific highligting: https://plaster.tymoon.eu/
13:31:43
francogrex
pastebin is the end of an era!!! it's yet another setback for common lisp... really makes me sad a little
13:46:25
pjb
The big problem with the absence of lisppaste, is that the other don't keep the history. With lisppaste, I could refer to pastes 3 or 5 year old!
13:53:51
jackdaniel
there was a discussion on mailing list about possibilities, nobody stepped in to propose that he can maintain it *and* keep it safe from spam
16:23:19
jmercouris
Any idea why my code is not working? https://gist.github.com/0fb1a792795b8ec02e26e0b419e3545c
16:31:06
jmercouris
What happened was I originally mistook NIL as "no matches" for remove-if, rather than the list was now empty
16:35:29
lisp_guest
i guess COND is taking those forms and treating them as code to evaluate, without expanding them?
16:37:16
lisp_guest
i knew you were going to ask that :D. i'm doing a simple rot-13 but it's not relevant. i'm just curious whether it's possible
16:40:58
lisp_guest
hm, what about a version of cond that would first macroexpand the forms in its clauses?
16:41:36
Bike
say you have a macro named foo and a variable named foo, what does (mycond (foo ...) ...) do?
16:42:13
Bike
additionally, the macros would only be valid in this one context, so if they appeared somewhere else by mistake you'd get hard to understand errors.
16:43:18
lisp_guest
Bike: why exactly is that case ambiguous? isn't it always treated as function or a macro call in normal code?
16:44:35
lisp_guest
beach: yeah, i was just thinking about that. essentially what i wanted was for this macro just to expand into a cond clause
16:45:17
beach
It wouldn't be if you macroexpand it yourself into a context where it is not evaluated.
16:48:20
lisp_guest
Bike: ah i see what you mean by ambiguous. i was thinking of MYCOND as something that would allow *only* macros for its clauses, but that it would indeed be limiting. if you allow both macros and "normal" clauses, then it's ambiguous
16:49:47
Bike
would you also have macros expand only once? because they could expand into ((condition ...) ...) which can't be macroexpanded, or into (foo ...) which only maybe means a variable and maybe is another macro
16:50:01
Bike
well, in short, it sounds kind of confusing. and i still don't really understand how this would be used.
16:50:34
lisp_guest
i was just wondering why (1) my code failed and (2) would there by a way around it
16:58:07
jmercouris
What's a way to find the class of a particular object (find--class) does not seem to do what I want
17:01:17
jmercouris
Well, at any rate, that is what I was looking for, if you have a bouncer or check the logs, thanks phoe
17:03:48
beach
jmercouris: I think basket is asking because it would be very unusual to have to do that.
17:05:17
jmercouris
If you have a Buffer, with several Mode object instances: (list Document-Mode-Object Application-Mode-Object)
17:05:33
jmercouris
One may wish to switch-mode to the Application-Mode-Object, but not have a reference to it
17:06:13
jmercouris
and it will look through the modes for an instance of Application-Mode-Class and switch to it
17:07:08
jmercouris
beach: That is not where I am using class-of, I'm only using it in add-or-switch-to-mode
17:07:39
jmercouris
The reason being that I want someone to be able to Create an Instance of a mode and pass it to add-or-switch-to-mode which will then EITHER ADD the mode, or SWITCH TO AN EXISTING MODE OF SAME CLASS
17:08:50
jmercouris
and what this will do is EITHER add document mode and switch to it, OR switch to an existing document-mode associated with the buffer
17:09:24
shka
does not change the fact, that i would add some minimal set of protocol classes for modes
17:15:39
beach
jmercouris: It is too late in the day for me to analyze your code. It shall have to wait.
17:15:59
jmercouris
beach: Ok, it's alright, the implementation will probably change 10 times before tomorrow anyway :P
17:17:44
Bike
so basically, you have a list of things, and you want to have a function that selects a node by class, and you use the actual class rather than anything it's an indirect instance of.
17:19:07
Bike
what if it has more than one mode of the same class? does it not matter what gets picked? or does that not happen?
17:20:27
jmercouris
shka: Make sure to compile it though, the changes aren't available in the release binary
17:20:59
Bike
it's unusual to discriminate objects by their class like that, is all. the only time i've ever seen it is clos internals.
17:34:15
beach
That's part of it, yes. SELF suggests a single dispatch language where you are not allowed to use the same name for a type and a parameter.
17:35:43
jmercouris
I'm afraid of what Lisp is doing to me mentally lol, maybe I won't be able to work with other languages again :D
17:36:25
beach
That's a very real risk. So if you don't want that to happen, you had better quit now, while there is still time.
17:36:29
jmercouris
I was writing python the other day and I started typing (print "something {}".format(some-variable)) which is of course a non-sensical mix of python and lisp
17:39:10
Shinmera
What annoys me most about working with other systems is typically not the syntax but the APIs. In Lisp I've so far had the "luxury" of just building everything myself.
17:39:35
jmercouris
Shinmera: Or even writing a macro on top of an API to use it in the way you wish
17:39:39
Shinmera
With anything else I always spend hours constantly googling documentation and how to do things.
17:39:59
Shinmera
And then get pissed because it turns out the designers didn't really design at all and you have to write some kinda shitty workaround.
17:40:19
jmercouris
consider Numpy and Pandas, completely break everything about python, get two of the most popular packages
17:46:36
jmercouris
beach: How serious are you? do you find yourself unable to work in other languages? Do you not frequently work in C?
17:52:57
shka
jmercouris: after working with lisp for extended period of time with lisp you start to feel like jim carrey of programming
18:46:05
phoe_
It only mentions that its arguments should be sequences. Reading from glossary, "sequence n. 1. an ordered collection of elements 2. a vector or a list."
18:46:40
phoe_
And, "list n. 1. a chain of conses in which the car of each cons is an element of the list, and the cdr of each cons is either the next link in the chain or a terminating atom. See also proper list, dotted list, or circular list. 2. the type that is the union of null and cons."
18:52:08
phoe_
circular lists are of type LIST because they are of type CONS, so they are a sequence, by that definition.
18:53:59
phoe_
I was trying to REPLACE a part of a circular list and I was a little bit bamboozled when it hung on a call to LENGTH.
19:13:23
shka
phoe_: nah, standard functions that are said to work on sequences, work on proper list
19:14:35
phoe_
ACTION finished his solution of this day's advent of code with a custom replace function
19:15:07
shka
obviously, working on circular lists in particular would require large overhead for each function
19:17:48
_death
phoe: here's my ugly one.. in my defense I was still halfway asleep.. https://gist.github.com/death/6d8271d50db60893706b097e5570322b
19:18:17
pjb
_death: list-length doesn't deal with circular lists, only dotted-lists. Use com.informatimago.common-lisp.cesarum.list:list-lengths instead.
19:19:23
pjb
But list-lengths is more useful, it returns the length of the stem and the length of the cycle.
19:19:47
whoman
there are some functions that detect circular, i wasnt sure if length was one of them
19:22:18
whoman
oh yes the book is 'art of symbolic computation' where i just finished circular list
19:22:26
jackdaniel
for arbitrary list circularity detection requires at least n steps, where n+1 cdr starts a circularity
19:30:34
drdo
_death: Right, but if you are using a circular list, you presumably want it to be an infinite list
19:43:32
phoe_
shka: vectors aren't circular, and this task explicitly deals with circular data structures.
19:43:50
aeth
There are many ways to get a "circular" data structure without literal circular lists.
19:45:09
_death
phoe: the access pattern hinted at by the problem suggests lists would not be efficient
19:48:18
aeth
A struct as circular buffer (array, start, end, emptyp) with two additional accessors (after enqueue and dequeue), for arbitrary middle access (but not deletion from the middle) would probably fit a lot of circular needs.
19:48:57
aeth
It wouldn't work well for arbitrary middle insertion/deletion (but even there there's probably a list scheme that doesn't require actual circularity)
19:50:32
phoe_
_death: yes, I get it. Computing this hash is instantaneous enough on my laptop though.
19:53:49
aeth
looks like advent of code only tracks how fast you get a solution, not how fast it runs
20:00:52
_death
aeth: and many people aren't even on a good timezone/sleeping schedule for that to matter
20:03:05
jmercouris
Given this method signature: https://gist.github.com/d3cf8bb20092fb1bf2cddd57912924d5
20:03:18
jmercouris
(switch-mode *active-buffer* 'application-mode) my code is returning that no applicable method
20:03:39
jmercouris
Yet, very clearly, there is a method that specilizes on class buffer with name switch-mode
20:12:15
lisp_guest
phoe_: yes, i was thinking something like that could be "hiding", since i'm really abusing apply in this case
20:14:07
phoe_
reduce will work on lists of arbitrary length where apply will only works on lists shorter than CALL-ARGUMENTS-LIMIT
20:15:54
lisp_guest
phoe_: yup, great, thanks. quite surprised to find that CALL-ARGMENTS-LIMIT is 4611686018427387903 :D
20:16:11
aeth
reduce will work on all sequences. apply can work in strange ways, such as taking in a plist and making those keyword arguments when applying. It doesn't just work on &rest functions.
20:17:04
aeth
(apply #'make-array 42 '(:element-type fixnum :initial-element 42 :adjustable t :fill-pointer 3))
20:21:04
aeth
phoe_: Theoretically, yes, but theoretically even long docstrings cause issues. There's a de facto minimum and it's usually much higher, with clisp as the lowest, when you go look for de facto minimums. It's no exception here, either. clisp is by far the lowest, at 4096. ecl and ccl are 65536 and sbcl is very, very large.
20:26:17
aeth
clisp is 4294967296, ecl is 2305843009213693951, ccl is 72057594037927936, and SBCL is 4611686018427387901
20:26:45
aeth
It's like that in all 64 bit limit comparisons *except* fixnum, where clisp's *is* low enough to cause problems
20:30:45
aeth
I should put together a document for all of the minimums given in the spec, but then I'd have to install a ton of additional implementations, including 32 bit versions of every implementation
20:32:10
_death
just yesterday sbcl exhausted heap when compiling my custom core.. so had to tweak dynamic-space-size.. there are more limits than standard limits ;)
20:59:55
aeth
People use CLISP because it was the most recommended implementation 10 years ago, and lots of people read things from 10 years ago.
21:01:23
aeth
It also (1) has a REPL with readline in the terminal without any hacking so it's approachable to people who aren't using emacs+slime and (2) has "C" in the name.
21:02:13
phoe_
but CLISP includes readline bindings, so it has a pleasant REPL where arrow keys work and such.
21:02:36
phoe_
4) it is an interpreter and has good support for unix commands, so can be fast and useful for scripting.
21:03:05
phoe_
CLISP has the nice repl out of the box, for other implementations you need to use rlwrap or such.
21:06:28
aeth
For an alternative view to the FSF's, you may want to look into what defenders of the GPLv2 (e.g. Linus) said back during the GPLv3 release controversy.
21:06:52
aeth
New GPLv2 projects are released as "GPLv2 or later" so they're not explicitly GPLv3-incompatible, though.
21:07:45
jmercouris
Yeah, Linus is actually the reason I'm very carefully considering which license to release under
21:08:17
jmercouris
if I have contributors to my project under License X, can I change the License at a latter time, or must I have all rights to all submitted work like the FSF does?
21:08:28
aeth
The third non-FSF approach to the GPL is the commercial approach where vendors require copyright assignment and sell an identical proprietary version of their library. I don't think there's an ideological view behind this, it's just a business model.
21:08:32
jmercouris
I'm just worried I'm going to make a bad license decision and it will be a pain later
21:08:58
jmercouris
I also am kind of taking the Shinmeraesque view point a little bit, that likely if someone wants to they can just steal my code regardless of the license, but I still feel like I should set the "correct" license
21:09:36
jmercouris
aeth: So wait, you are telling me they SELL their GPL software? why wouldn't someone just download it and use it?
21:09:36
aeth
jmercouris: You can go from a GPL-compatible license to the GPL. It's trickier going the other direction, especially since no one wants to do copyright assignment because of e.g. what Oracle did to Sun's projects.
21:10:05
phoe_
jmercouris: they have the copyright, they can release two versions of the code with different licenses.
21:10:09
jmercouris
I wish I could dual license with BSD and have a clause that says you cannot use it for commercial purposes or something
21:10:15
aeth
"GPLv2 or later" or "GPLv3 or later" isn't a technicality, it's a necessity if you want to change licenses later on.
21:10:25
phoe_
one is GPL and you don't need to pay for it, the other is proprietary and you need to pay fro it.
21:10:50
phoe_
jmercouris: feel free to, there are a few commonly used non-commercial licenses around.
21:13:00
aeth
jmercouris: The GPL doesn't stop people from using it for commercial purposes (e.g. Red Hat or Oracle or Canonical or even Google) and there's a network loophole to the GPL that the AGPL attempts to fix (i.e. if you make your Foo library I can make a commercial Foo as a Service website and since I'm not distributing binaries of your Foo, it's allowed)
21:13:28
aeth
In fact, forbidding commercial use (e.g. half of the Creative Commons licenses) is explicitly not allowed under the open source definition.
21:13:47
aeth
The idea of the GPL is to just make it unattractive for commerical use, not forbid it.
21:14:44
phoe_
Wrong, the idea of GPL is to make sure the users of the software have the four freedoms defined as essential by the FSF.
22:13:39
jmercouris
aeth: You are correct, certainly it does not prohibit that use, but I am developing an application, not a library, so it'd be hard to spin it into something else
22:34:05
aeth
jmercouris: I'm not sure what the difference between an application and a library really is, especially in a language like Lisp.
22:34:54
jmercouris
I always think I have my mind made up, but then a conversation like this makes me start all over again mentally
22:41:00
aeth
Josh_2: An application is (probably too simply) a library with an entry point. In Lisp, you're free to ignore the entry point and directly access things, even private things. You could probably even do this on a saved lisp image that isn't tree shaken.
22:41:15
aeth
An application would have to be pretty fragile with globals everywhere, etc., to have nothing useful to someone else.
0:04:01
jmercouris
republican_devil: I don't know what Xach uses, but Shinmera has a framework called radiance, is quite nice
0:46:34
drmeister
I believe that ASDF is using the system clang compiler and I need it to use a different clang compiler
0:52:14
drmeister
ASDF does compile C source - correct? I see the pzmq library generates a grovel__grovel.c file - that is compiled somehow to a .o file.
0:54:32
jfe
drmeister: unfortunately i'm an amateur on asdf. but i had a question for you. the other day i asked why compilers aren't more frequently written in high-level languages like lisp. if i understand correctly, you wrote the clasp compiler in c++. why did you choose c++ instead of lisp?
1:02:13
drmeister
jfe: I did not write the clasp compiler in C++. Clasp has one interpreter written in C++ and two compilers written in Common Lisp.