freenode/#lisp - IRC Chatlog
Search
6:10:25
axion
Does anyone happen to use company-mode in common lisp code buffers? I am trying to switch from auto-complete, but it seems to only be working in the repl mode. I would be interested in checking out someone's emacs config if it's no trouble.
8:22:22
phoe
Also (digits -12345) ;=> 5 and (digits 0) ;=> 1, but these are easy once I have the tool for positive integers.
8:22:30
beach
Yes, the logarithm base 10 will probably. You might run into problems with precision if the numbers are large.
8:43:52
loke
The native function create_thread returns the thread id, but that return value is thrown away.
8:45:55
loke
You can see a call to %create-thread there. It checks whether the retyurn value is zero, bu8t if not, it should save it in the thread structure.
9:21:21
phoe
Is there any MOP way to prevent defining any writer or accessor functions for a class? I want to create a class that is immutable, as in, its slots are only set during creation.
9:26:52
beach
You define a subclass of STANDARD-CLASS, and then you define a method on (SETF SLOT-VALUE-USING-CLASS) that specializes to the new metaclass.
9:27:37
phoe
Will this error be called during the compilation of a SETF method, or when such a method is used?
9:46:17
phoe
More importantly - if I declare this metaclass IMMUTABLE-CLASS to be a protocol class, meaning that it can't be instantiated, will I have to create a STANDARD-IMMUTABLE-CLASS as an implementation and use this as :METACLASS in DEFCLASS?
9:48:51
phoe
More generally speaking, are metaclasses instantiated? If so, at which moment? How many?
10:03:56
phoe
Because if BAZ is a protocol class, then it cannot be instantiated. Only its subclasses can be instantiated.
10:04:37
phoe
I can't instantiate FOO, because it means that I'll have to instantiate BAZ, which is an error.
10:05:16
phoe
Because, by definition, protocol classes cannot be instantiated. BAZ is a protocol class, so I cannot instantiate it.
10:05:34
loke
phoe: There is no definition of "protocol class" in the clhs nor the AMOP as far as I know.
10:11:57
_death
phoe: when you define a class, a class object is instantiated.. this is a metaobject, and its class is a metaclass
10:18:57
phoe
so my assumption was correct - I need to create a protocol metaclass, then an concrete metaclass, and then use the concrete metaclass in class definition.
10:22:15
phoe
What is the proper verb to use when describing the relation between classes and metaclasses?
10:23:37
phoe
"The :metaclass class option is used to specify that instances of the class being defined are to have a different metaclass..."
10:36:59
phoe
beach: I'm in some trouble here. A simple method on (setf slot-value-using-class) prevents me from initializing the object.
10:41:28
loke
But I find the whole idea to be rather strange. Surely just not defining a writer method is signal enough that the instance isn't meant to be changed.
11:59:14
phoe
beach: Can protocols depend on each other? I have protocols FOO and BAR, where FOO has an operation FROB and BAR has an operation SCER; SCER calls FROB as a part of its operation.
12:00:05
phoe
Does it mean that both of these protocols should be merged into one, or is such a "dependency" okay?
12:20:30
phoe
There are exceptions to this, for example, Roomba was written using a subset of Common Lisp that was then compiled to code that ran on microcontrollers.
12:21:26
phoe
Low-level hardware stuff is doable. But then again, define "low-level hardware stuff".
12:24:30
beach
phoe: "operation" in this context means roughly "a function". You used it "for its operation" which suggests that it is doing something.
12:24:55
phoe
tetero: grab VirtualBox, download the latest demo (third one I think) and go play Quake-on-a-Lisp.
12:25:26
tetero
phoe: Since your talk of CCFI, I got a bit curious as to the more unusual uses of Lisp. Ran into GOAL/GOOL which, while not Common Lisp, is a pretty cool example of what you /can/ do
12:27:15
phoe
tetero: well, CFFI makes it easy to create a REPL in which you can poke/peek arbitrary bytes of memory - kind of like it was back in the days of simple computers like Apple 2
12:27:18
schweers
I know people who love doing low-level stuff and even I can sometimes get a rush out of doing things at a low level
12:28:46
phoe
beach: I am confused now. Yes, I wrote, "for its operation" - I think that MOP contains parts like this, where a description of function FOO has a phrase that under some circumstances function FOO will call function BAR.
12:30:06
schweers
I’m always sad when I see something like mezzano, because I know I’ll never be able to use it for real :/
12:31:01
phoe
you don't know what future brings, and if Mezzano got it to this level from pure scratch, then it can go from this level to be much more usable
12:31:50
schweers
I just fear that it will never have enough software because people will be scared of it
12:33:19
phoe
tetero: I think you can check the git logs for who contributes there, or how many contributors there are in total with how many commits.
12:34:40
schweers
do you know off the top of your head how they got quake and doom (i.e. existing applications) to run on mezzano? I’m guessing some sort of emulation or compatibility layer
12:35:56
schweers
um … they translated the C code to CL? but still, I’m wondering because of all the APIs these programs use (for instance opengl)
12:36:33
tetero
Damn. I'm looking at the Mezzano contributors, and while it has 8 contributors, almost all code is written by one guy
12:37:07
tetero
Not to take away from froggey, but it definitely flexes some of lisps muscles in output if one knows it well
12:39:17
tetero
phoe: It seems to give you plenty of rope that you can either use to do something great, or hang yourself with
12:39:52
phoe
While I do it for my own purposes, as in, I'm trying to grasp and understand what protocols are and aren't, I kind of hope that I'm also asking questions difficult enough to cover some corner cases in your chapter about protocols.
12:40:32
schweers
I can’t help it, but I don’t think that lisp makes it particularly easy to hang oneself with, unless performance is particularly relevant
12:40:37
phoe
Like this thing right here, about protocol descriptions mentioning calling other operations.
12:42:58
schweers
although lisp programs can become anbearibly slow if one doesn’t know what one is doing