LainExperiments has quit [Ping timeout: 240 seconds]
wbooze has joined #commonlisp
mad` has joined #commonlisp
kevingal has joined #commonlisp
alfiee has quit [Ping timeout: 252 seconds]
mad` has quit [Remote host closed the connection]
wbooze has quit [Ping timeout: 248 seconds]
dra has quit [Ping timeout: 268 seconds]
LainExperiments has joined #commonlisp
jonatack has quit [Read error: Connection reset by peer]
jonatack has joined #commonlisp
pkal_ has joined #commonlisp
skin has quit [Ping timeout: 244 seconds]
pkal has quit [Ping timeout: 272 seconds]
pkal_ is now known as pkal
chomwitt1 has quit [Ping timeout: 268 seconds]
King_julian has joined #commonlisp
ufi has joined #commonlisp
ufi has quit [Remote host closed the connection]
elderK has quit [Quit: WeeChat 4.5.1]
alfiee has joined #commonlisp
alfiee has quit [Ping timeout: 268 seconds]
kevingal has quit [Ping timeout: 245 seconds]
wizard has quit [Read error: Connection reset by peer]
wizard has joined #commonlisp
yaneko7 has joined #commonlisp
yaneko has quit [Ping timeout: 244 seconds]
yaneko7 is now known as yaneko
Pixel_Outlaw has quit [Quit: Leaving]
bilegeek has joined #commonlisp
alfiee has joined #commonlisp
geminium has joined #commonlisp
LainExperiments9 has joined #commonlisp
alfiee has quit [Ping timeout: 276 seconds]
LainExperiments has quit [Ping timeout: 240 seconds]
geminium has quit [Ping timeout: 244 seconds]
King_julian has quit [Ping timeout: 260 seconds]
Pixel_Outlaw has joined #commonlisp
rendar has joined #commonlisp
rendar has quit [Changing host]
rendar has joined #commonlisp
mange has joined #commonlisp
NotThatRPG has quit [Remote host closed the connection]
NotThatRPG has joined #commonlisp
NotThatRPG_ has joined #commonlisp
jonatack has quit [Ping timeout: 252 seconds]
NotThatRPG has quit [Ping timeout: 245 seconds]
jonatack has joined #commonlisp
random-nick has quit [Ping timeout: 260 seconds]
josrr has quit [Ping timeout: 245 seconds]
fuloido has joined #commonlisp
alfiee has joined #commonlisp
alfiee has quit [Ping timeout: 244 seconds]
bilegeek has quit [Quit: Leaving]
bilegeek has joined #commonlisp
gooba has quit [Remote host closed the connection]
gooba has joined #commonlisp
pkal_ has joined #commonlisp
pkal has quit [Ping timeout: 252 seconds]
pkal_ is now known as pkal
troojg has joined #commonlisp
alfiee has joined #commonlisp
zwr has joined #commonlisp
waleee has quit [Ping timeout: 272 seconds]
troojg has quit [Ping timeout: 260 seconds]
alfiee has quit [Ping timeout: 252 seconds]
surabax has quit [Quit: Leaving]
NotThatRPG_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
LainExperiments9 has quit [Quit: Client closed]
RavenJoad has joined #commonlisp
varjag has joined #commonlisp
<RavenJoad>
Hey all! I have a question real quick. I want to define something that subtypes the string type/class. But metaclasses get in the way. ,(defclass a-symbol (string) ())
<ixelp>
(defclass a-symbol (string) ()) ERROR: The class #<BUILT-IN-CLASS STRING> was specified as a ↩ super-class of the class #<STANDARD-CLASS A-SYMBOL>; ↩ but the meta-classes #<STANDARD-CLASS BUILT-IN-CLASS> and ↩ #<STANDARD-CLASS STANDARD-CLASS> are incompatible.
<semz>
RavenJoad: Subclassing built-in classes is explicitly not allowed by the standard so that the implementation is free to choose more efficient representations that would conflict with such a thing
<RavenJoad>
Ah. Ok. I missed that part then. I am defining a symbol class which is implemented just as a string for now. But I want to inherit the string functions/methods. Is there a way to accomplish that, since the standard says we cannot subclass built-ins?
<semz>
for the sequence functions, you could check if your impl supports extensible sequences, but for the string functions I'm not so sure
alfiee has quit [Ping timeout: 268 seconds]
<RavenJoad>
The symbol is for another language, not Lisp, so it should remain a string.
<RavenJoad>
semz: I'm primarily using SBCL for now.
<semz>
SBCL definitely supports extensible sequences at least
<RavenJoad>
I also _technically_ test against ECL, but I haven't checked it for a long time.
<RavenJoad>
I'm barely using any string functions/methods for symbols right now. The key thing I want is the initialization method for the symbol sanitizes and converts characters in the input string that are incompatible with the chosen compilation backend.
<RavenJoad>
For example, Verilog disallows hyphens in symbols, but I am allowing them in my language, so when I switch from my language to Verilog, I want the Verilog symbol constructor to make the necessary replacements.
<semz>
Would a simple string-to-string sanitization function suffice or is it important that they have a distinct type?
<semz>
defining a print-object method that lets you use your symbols in format and friends could possibly also be a workaround depending on what you need
<RavenJoad>
It is not terribly important that they have distinct types. I'm just an idiot and want things to tell me that I made a mistake about strings. I already have a string->string sanitizer defined. I just want it to be "automatic" by constructing an instance of a symbol.
<RavenJoad>
In the long-run, the symbol might be backed by an interning structure to prevent redundant allocations for the same symbol.
fuloido has quit [Ping timeout: 260 seconds]
<beach>
RavenJoad: What does it mean for your symbols class to be "implemented just as a string"?
<beach>
If it is "implemented just as a string", then I would think it *is* a string, no?
psilord has joined #commonlisp
triffid has quit [Remote host closed the connection]
triffid has joined #commonlisp
<RavenJoad>
What I mean is that I want the freedom to change exactly how the symbol is backed. Right now the symbol foo-thing would be implemented as the string "foo-thing". In the future, I might change it to be a table index so foo-thing -> index 3, and index 3 -> "foo-thing".
<beach>
That doesn't answer my question, but it's unimportant. The standard string functions work on the standard string class, so you can't reuse them for anything else.
<beach>
And I don't know what it means for an object to be "backed".
<mange>
If you want the freedom to replace the string with something else later then you can't write code against it as a string now. Even if you could subclass string, that would be a mistake because you don't *want* to call string functions on it. That would lock you into using a string.
<beach>
And that, yes.
<RavenJoad>
mange: You're right. But I'm lazy and don't know what methods I will use right now. So I was thinking sub-class string for now, see what I use, then if I change the backing implementation I will handle that later.
<RavenJoad>
Backed is probably the wrong term too.
<mange>
Right, but having to go through your code and change all the places where you assumed it was a string isn't much "freedom", to my mind. :)
<beach>
RavenJoad: mange is right. You would want to define your own protocol (i.e., interface) to your symbol class.
<RavenJoad>
It isn't, you're right. On the bright side, all uses of this class will occur inside the same package.
<beach>
RavenJoad: And since you can't subclass STRING, it seems you have no choice.
<RavenJoad>
beach: Right. I just don't know how much of an interface I need yet. Which is why I am falling back to using strings. I can treat things as if they were strings and handle the problem later.
<RavenJoad>
But given that I cannot subclass, its sounding like you're both right.
<RavenJoad>
Now to go off and define a whole new class again. I wish I could teach already-existing functions (uiop:strcat) about these objects, but that's a different problem.
fuloido has joined #commonlisp
<beach>
If the implementation of your SYMBOL class *contains* a string, you can just trampoline to the string functions. That's a much more sane way of doing it anyway.
<beach>
As in (defun my-package:concatenate (symbol1 symbol2) (make-symbol (uiop:strcat (underlying-string symbol1) (underlying-string symbol2))))
<beach>
RavenJoad: Then if you change the implementation of your SYMBOL class later, only two functions need to change, namely UNDERLYING-STRING and MAKE-SYMBOL.
<RavenJoad>
That is what I was planning on doing for the things that did not accept strings. This subclass-ing business was just a way to skip having to implement functions/methods that I could not predict ahead-of-time.
triffid has quit [Remote host closed the connection]
<RavenJoad>
The subclass-ing business was just because I am lazy.
triffid has joined #commonlisp
<RavenJoad>
I'm not even using any functions on these symbols right now, other than (format "~a" a-symbol), which I guess I will have to figure out how to define.
alfiee has joined #commonlisp
fuloido has quit [Ping timeout: 244 seconds]
<mange>
That should be easy to do with print-object. ,(defclass a () ()) ,(defmethod print-object ((obj a) stream) (format stream "I'm an A!")) ,(format nil "~a" (make-instance 'a))
<ixelp>
(defclass a () ()) => #<STANDARD-CLASS A> and (defmethod print-object ((obj a) stream) (format stream "I'm an A!")) => #<STANDARD-METHOD PRINT-OBJECT (A T)> finally (format nil "~a" (make-instance 'a)) => "I'm an A!"
soweli_iki has joined #commonlisp
alfiee has quit [Ping timeout: 252 seconds]
<RavenJoad>
I didn't realize print-object was the method called for ~a, since I usually see that for REPL print-out. That's easier than I thought.
pfdietz has quit [Ping timeout: 240 seconds]
triffid has quit [Remote host closed the connection]
triffid has joined #commonlisp
<beach>
RavenJoad: We need to work on your terminology. PRINT-OBJECT is a "generic function" that has methods on it. Methods are not called directly; generic functions are. The discriminating function of the generic function is what calls the method(s).
<RavenJoad>
Right. I'm using my C++/Java OOP terminology bleed through.
<RavenJoad>
s#using#letting#
<mange>
I've been doing so much Ruby lately that I accidentally say "method" instead of "function" all the time.
Guest23 has joined #commonlisp
Guest23 has left #commonlisp [#commonlisp]
<aeth>
Terminology is annoyingly slightly (or significantly) different in every programming language, even similar ones (like Scheme to CL)
bilegeek has quit [Quit: Leaving]
fuloido has joined #commonlisp
alfiee has joined #commonlisp
fuloido has quit [Ping timeout: 248 seconds]
decweb has quit [Quit: Konversation terminated!]
<Pixel_Outlaw>
aeth, especially when people say that a "method belongs to an object" but in CL a method is more of a dispatch mechanism.
alfiee has quit [Ping timeout: 260 seconds]
<aeth>
try to communicate about a 'vector' to someone using another programming language, too
<aeth>
in some languages it implies adjustable, while in CL it just implies 1D
<aeth>
(adjustable is a bit... unusual since mathematical/physics vectors aren't)
<aeth>
I'm sure I've implied it's adjustable 100 times without realizing it
<aeth>
Python's "list" is a particularly bad misuse (since that name, everywhere else, implies linked list)
markb1 has quit [Ping timeout: 245 seconds]
<beach>
That's what I thought before I talked to my theoretician colleagues, who think "list" is an abstract data type that I would call a "sequence".
<beach>
So not "everywhere".
fuloido has joined #commonlisp
olnw has joined #commonlisp
pfdietz has joined #commonlisp
<Alfr>
So, your "sequences" are finite?
<beach>
Yes, the abstract data type I was thinking of then would be finite.
markb1 has joined #commonlisp
<beach>
The operations would take an index, like finding an element at an index, inserting an element before an element at an index, deleting an element at an index.
<beach>
s/finding/returning/
mishoo has joined #commonlisp
<beach>
Actually, I have usually called it "editable sequence" to distinguish it from the Common Lisp SEQUENCE class.
<Alfr>
Makes sense. (Though, can't play Hilbert's hotel with them.)
fuloido has quit [Ping timeout: 276 seconds]
markb1 has quit [Ping timeout: 248 seconds]
alfiee has joined #commonlisp
alfiee has quit [Ping timeout: 252 seconds]
<aeth>
Alfr: well, in mathematics, sequences are often defined to be infinite. Or at least, the infinite ones are the object of interest (and you look to see if e.g. they converge or not... unordered sets and ordered n-tuples (e.g. ordered pairs) tend to be the finite things you encounter)
<aeth>
so it makes sense that to avoid any kind of confusion, another term could be used, such as, I guess "list"
LainExperiments3 has quit [Ping timeout: 240 seconds]
alfiee has joined #commonlisp
LainExperiments5 has joined #commonlisp
alfiee has quit [Ping timeout: 272 seconds]
LainExperiments has quit [Ping timeout: 240 seconds]
Guest3814 has joined #commonlisp
mishoo has quit [Ping timeout: 248 seconds]
bpanthi977 has quit [Read error: Connection reset by peer]
josrr has quit [Ping timeout: 276 seconds]
bpanthi977 has joined #commonlisp
josrr has joined #commonlisp
Guest3814 has quit [Quit: WeeChat 4.5.2]
slyrus_ has quit [Ping timeout: 248 seconds]
LainExperiments has joined #commonlisp
Pixel_Outlaw has joined #commonlisp
LainExperiments5 has quit [Ping timeout: 240 seconds]
pfdietz has quit [Ping timeout: 240 seconds]
zxcvz has joined #commonlisp
zxcvz has quit [Client Quit]
alfiee has joined #commonlisp
alfiee has quit [Ping timeout: 244 seconds]
LainExperiments has quit [Quit: Client closed]
Lord_Nightmare has joined #commonlisp
mwnaylor has joined #commonlisp
LainExperiments has joined #commonlisp
wavedepletion has joined #commonlisp
LainExperiments has quit [Quit: Client closed]
jon_atack has quit [Read error: Connection reset by peer]
josrr has quit [Ping timeout: 252 seconds]
jonatack has joined #commonlisp
alfiee has joined #commonlisp
geminium has quit [Ping timeout: 272 seconds]
alfiee has quit [Ping timeout: 252 seconds]
veqq has joined #commonlisp
zephyr has quit [Ping timeout: 272 seconds]
zephyr has joined #commonlisp
wbooze has joined #commonlisp
yazz has quit [Ping timeout: 260 seconds]
yazz has joined #commonlisp
luis has quit [Quit: Ping timeout (120 seconds)]
luis has joined #commonlisp
gnoo has joined #commonlisp
zephyr has quit [*.net *.split]
sirufer has quit [*.net *.split]
Schnouki has quit [*.net *.split]
iquites has quit [*.net *.split]
kurfen has quit [*.net *.split]
aeth has quit [*.net *.split]
Fade has quit [*.net *.split]
Grauwolf has quit [*.net *.split]
deadmarshal_ has quit [*.net *.split]
gosha_ has quit [*.net *.split]
mcoll has quit [*.net *.split]
nytpu has quit [*.net *.split]
theothornhill has quit [*.net *.split]
timmy has quit [*.net *.split]
jmbr has quit [*.net *.split]
arpunk has quit [*.net *.split]
HerlockSholmes has quit [*.net *.split]
bmp has quit [*.net *.split]
entro has quit [*.net *.split]
Mandus has quit [*.net *.split]
luna-is-here has quit [*.net *.split]
kdlv has quit [*.net *.split]
griffinmb___ has quit [*.net *.split]
gnoo_ has quit [*.net *.split]
adrianbrink has quit [*.net *.split]
disruptek has quit [*.net *.split]
tux0r has quit [*.net *.split]
smlckz has quit [*.net *.split]
lieven has quit [*.net *.split]
sirufer has joined #commonlisp
theothornhill has joined #commonlisp
zephyr has joined #commonlisp
deadmarshal_ has joined #commonlisp
HerlockSholmes has joined #commonlisp
timmy has joined #commonlisp
jmbr has joined #commonlisp
aeth has joined #commonlisp
Grauwolf has joined #commonlisp
Fade has joined #commonlisp
griffinmb___ has joined #commonlisp
bmp has joined #commonlisp
nytpu has joined #commonlisp
kdlv has joined #commonlisp
arpunk has joined #commonlisp
entro has joined #commonlisp
adrianbrink has joined #commonlisp
luna-is-here has joined #commonlisp
tux0r has joined #commonlisp
Schnouki has joined #commonlisp
kurfen has joined #commonlisp
iquites has joined #commonlisp
disruptek has joined #commonlisp
gosha_ has joined #commonlisp
mcoll has joined #commonlisp
Mandus has joined #commonlisp
smlckz has joined #commonlisp
lieven has joined #commonlisp
sirufer has quit [Max SendQ exceeded]
Schnouki has quit [Max SendQ exceeded]
sirufer has joined #commonlisp
Schnouki has joined #commonlisp
Equill has quit [Ping timeout: 244 seconds]
LainExperiments has joined #commonlisp
alfiee has joined #commonlisp
pve has quit [Quit: leaving]
alfiee has quit [Ping timeout: 252 seconds]
zwr has quit [Remote host closed the connection]
drasken has quit [Quit: Leaving.]
LainExperiments has quit [Ping timeout: 240 seconds]
varjag has quit [Read error: Connection reset by peer]
varjag has joined #commonlisp
mange has joined #commonlisp
LainExperiments has joined #commonlisp
screwlisp has joined #commonlisp
alfiee has joined #commonlisp
pfdietz has joined #commonlisp
alfiee has quit [Ping timeout: 252 seconds]
ello has quit [Read error: Connection reset by peer]
ello has joined #commonlisp
<screwlisp>
Lispy gopher climate soon/in one hour, notes on my first language parser implementation (chinese chess hosted by common lisp) since it's not the direct topic of my ELS submission. ACM LaTeX templates relatedly, inequality essay by KMP, I'm holding out hope that one of you self-selects into being a guest now or in the future. https://anonradio.net:8443/anonradio
wbooze_ has joined #commonlisp
wbooze has quit [Ping timeout: 245 seconds]
fuloido has joined #commonlisp
fuloido has quit [Remote host closed the connection]
LainExperiments has quit [Quit: Client closed]
chomwitt1 has joined #commonlisp
geminium has joined #commonlisp
geminium has quit [Ping timeout: 260 seconds]
josrr has joined #commonlisp
veqq has quit [Quit: veqq]
wbooze_ has quit [Remote host closed the connection]
wbooze_ has joined #commonlisp
attila_lendvai has quit [Ping timeout: 244 seconds]
alfiee has joined #commonlisp
varjag has quit [Read error: Connection reset by peer]
alfiee has quit [Ping timeout: 244 seconds]
varjag has joined #commonlisp
varjag has quit [Ping timeout: 244 seconds]
chomwitt1 has quit [Ping timeout: 265 seconds]
LainExperiments has joined #commonlisp
doyougnu- has joined #commonlisp
doyougnu has quit [Ping timeout: 265 seconds]
dra has quit [Ping timeout: 252 seconds]
<screwlisp>
https://anonradio.net:8443/anonradio 15 minutes. I spent the last hour reading Didier's binary methods in CLOS using thet MOP 2008 article so that's now the unofficial topic ;p