freenode/#lisp - IRC Chatlog
Search
8:41:01
Shinmera
phoe: From reading what you linked it seemed to me that they pretty heavily favoured making it CLOS, but then didn't have time to finalise the details of it.
8:41:27
phoe
Shinmera: I need to read it again when I'm not at work. I didn't get that impression when I read it.
8:57:33
phoe
Shinmera: I actually did a thing and things seem to "somewhat" work for the little bit of testing I have done so far. This thing is (defmethod sb-mop::validate-superclass ((class sb-mop::standard-class) (superclass sb-pcl::condition-class)) t)
9:10:58
Xof
phoe: you might have some difficulty getting slot locations right for such a hybrid object
9:11:42
phoe
Xof: I actually don't think I want to pursue this thing since it's not exactly that I would like.
9:14:33
phoe
Instead of cross-breeding standard-class and condition by means of objects that subclass both, I wonder if it would be possible to make condition a subclass of standard-object.
9:34:19
phoe
Xof: the ability to drive conditions via CLOS and MOP, even partially, sounds worth it in my opinion
10:01:30
phoe
I hit a wall today because I can't make constructors for conditions that work out-of-the-box with the stock #'make-condition
10:01:56
phoe
where I'd normally write (defmethod initialize-instance :after ...) for standard-objects
10:05:14
phoe
and workarounds like (:shadowing-import-from :my-package #:make-condition) doesn't work universally
11:34:08
phoe
TIL I can do (defmethod initialize-instance :after ((warning style-warning) &key) (print "boo"))
11:45:14
Shinmera
phoe: You can but, if I remember correctly, initialize-instance is not always called.
12:07:05
phoe
I don't want a constructor to catch anything, I want a constructor to do things whenever a my-condition is instantiated
13:28:00
elderK
I've been working on a tool to help me play with grammars. I spent my mid-semester break making several iterations of said tool. I just finished it. It let you compute the first/follow sets for an arbitrary grammar it read from stdin. It also allowed you to produce an LL(1) parse table, if possible, for said grammar. It was written in C++.
13:28:54
elderK
I will have to rewrite it some time in the future. As, it would have been a useful tool for me to have.
13:29:55
elderK
I really wanted to show a lecturer of mine the finished product. As well as some others.
13:30:24
elderK
Normally I treat VCS as backup. If only I had committed my work *as* I was building it, as usual, I could have just reverted.
13:30:44
phoe
elderK: not just you, https://github.com/valvesoftware/steam-for-linux/issues/3671 https://github.com/MrMEEE/bumblebee-Old-and-abbandoned/commit/a047be85247755cdbe0acce6f1dafc8beb84f2ac#diff-3fbb47e318cd8802bd325e7da9aaabe8L351
13:31:21
elderK
In any case, as much as this sucks, at least I know I can produce such a program. And that's worth something, the know-how too.
13:31:25
dlowe
if you use git and emacs, there's a nice git-wip library that will save every edit in a "work in progress" branch
13:31:49
elderK
I was here a few days ago, asking how to represent a state machine in CL. I was told that tagbody and gotos are a common way to do that in CL.
13:32:07
elderK
However, there is an approach I like to use from the C world and I'm not sure if it maps well to CL - and if it does, how.
13:32:56
elderK
A TAGBODY and GOs makes me think of switches and gotos. I don't really like that, so usually I have a 2D array. One axis is the current state, the second axis is the input. That let's me transition just by accessing.
13:33:07
dlowe
the way you represent a state machine in CL is with state functions that return the next state function
13:35:24
elderK
Again from C, let's say for a lexer I'm accepting some input character. Generally, I don't care about characters. I care about entire classes of characters so I have a LUT that translates a given code-point to a given class. Say, "=" to "equals" and all of the numbers and alphabet as "alphanumeric."
13:35:47
elderK
I see people doing that with giant switches in C/C++. I;d like to avoid that in CL if possible.
13:35:56
dlowe
also, you have constrained the problem to that of a state machine, whereas there are no such guarantees with tagbody
13:36:36
elderK
phoe: I'm not reading anything here. The functions that do stuff based on input, accept input as an argument.
13:37:30
elderK
I'm not interested in the actual "class" of a character. I'm interested in translating a character into something useful to me, in a sense, they become low-level tokens.
13:37:57
rumbler31
elderK: you're asking essentially if there is language support for dispatching on X, where X is some thing
13:38:35
rumbler31
you can do it with a hash table by hand, or if you can dispatch on eql, you can use generic functions
13:40:45
elderK
Let's say I care about all code points < 128. I create a hash table. Initialize it so all 128 code points are say, 'invalid. Then, I build the proper mappings.
13:41:04
dlowe
but involving the CLOS dispatch mechanism for zero benefit seems like a poor tradeoff
13:43:26
elderK
But this does raise another question: What is the accepted way to get a given character's code point? I have found char-code and char-int. And, am a little confused with the difference between them.
13:45:21
dlowe
I mean, if your cl implementation supports unicode (and most of them do, if not all of them), char-code and code-char will do the right thing
13:46:27
elderK
Then I don't have to do the decoding myself :) (I wrote a library for that some time ago. I'd certainly be happy to avoid that! :D)
13:48:29
elderK
Weird. I can't see anything in cl-unicode's API about it, itself, doing any kind of reading of characters. It lets you determine a lot of interesting properties about characters based on their name or code-point. But, that depends on the implementation giving you a code-point.
14:24:09
rk[ghost]
right, i didn't go that far.. i knew i was in google.. but when i went to type a math equation.. my mind said... operator first!
14:24:24
phoe
rk[ghost]: ssh from the second machine to the one that has the repl, or go for remote swank
14:57:16
mrpat
I have an issue with parsing a uri from JSON. Once it is parsed, the repl evals it and counts the : as a package delimiter and spews an error. Is there a simple fix?
15:05:37
Bike
why do you even have this literally in your code? will this not be like, a variable with a string in it, later?
15:06:12
dlowe
since we don't have curly quotes in our code (and maybe we should!) it can't figure out where your quotations begin and end
15:07:09
Bike
if you write "foo" bar "baz" in your code obviously the code parser is going to think it's two strings.
15:07:39
Bike
So escape the internal quotation marks if you write it literally in the code like that.
15:08:01
Bike
I'm just asking because having literal json in your code seems unusual. Usually you'd be reading it off the wire or something, I would think.
15:09:39
mrpat
I am just trying to get used to dealing with it. I will be sending and receiving JSON through a socket connection.
15:14:03
Bike
If you write "foo\" \"bar", the parser sees the backslashes and accumulates a literal double quote character into one string instead.
15:16:13
Bike
When you actually are getting raw json, that will just be a string in your program, and the lisp parser won't get anywhere near it.
15:16:17
easye
Is there any portable way to read user input from a terminal without echoing the characters typed? (I need to input a passphrase).
15:16:55
Bike
And for that you do have to escape it, because otherwise it can't be parsed with the code, because "foo" "bar" would obviously read as two strings and so on.
15:18:01
Bike
because with-input-from-string would go hey wait, why are you giving me like eight strings instead of one string.
15:19:58
Bike
if you expect to be using literal json a lot, you could alter the parser a bit so that you don't need to escape things.
15:21:08
semz
easye: Unices have getpass (unistd.h), and while I'm not aware of any CL wrapper it's a simple FFI call. Whether FFI is "portable" is another question though.
19:17:18
aeth
The two ECLs (one in roswell and one from the distro package manager) that I have installed failed differently, which suggests a cached fasl issue. I managed to fix the one from the package manager.
19:18:20
aeth
It looks like the one in roswell fails in process-grovel-file with ":INPUT argument to RUN-PROGRAM does not have a file handle:\n#<a SWANK/GRAY::SLIME-INPUT-STREAM>"
19:21:58
aeth
hmm, I thought deleting the caches for slime, static-vectors, and cffi would fix it but it did not.
19:39:55
LdBeth
ACTION uploaded an image: ima_e4a35ae.png (103KB) <https://matrix.org/_matrix/media/v1/download/matrix.org/VtWmbyVTaLjtfLLTQgxLBHbS>
20:14:46
fortitude
if I want to invoke a restart from a handler, and I want the same handlers to remain in effect, is the only way to do that to invoke the restart from some call-with-handlers function to re-establish them?
20:15:29
on_ion
joh11: try to disable eldoc[-mode] if you've got it on? it errors for me in a different way but ive got a fix in the code on my machine for it
20:19:04
joh11
on_ion: disabled it, but I still have the errors. However now the company-mode small autocompletion is popping, so I think it was still part of the problem