freenode/#lisp - IRC Chatlog
Search
15:52:00
Nilby
I worked on a structre editor and my biggest problem was indendting and line filling, eg. when to + 2 3 vs. + next-line 2 next-line 3
15:55:40
Nilby
My fingers typed it, but my brain as usual has little recollection of the event. It so far hasn't made it out of the laboratory.
16:03:35
Nilby
I think I used medley a little bit a long time ago on a TI lispm. it was cool but as an emacs user, the key bindings felt awkward and would take some getting used to, probably like paredit.
16:11:44
kirtai
there's a short manual for sedit in the medley release notes at appendix b in this document: http://bitsavers.trailing-edge.com/pdf/xerox/interlisp-d/198809_Medley_1.0/400006_Lisp_Release_Notes_Medley_Release_1.0_Sep88.pdf
17:06:48
tfb
SEdit was ... well, if you haven't used SEdit it's hard to describe what it was like, but it was astonishing, or at least I remember it being so.
18:20:36
Xach
As I wrote, I'm happy to add anything and (perceived by me) quality is not a roadblock. But I do look at personal utility libraries a little harder than other stuff and would love to see if the authors are open to feedback and possible improvement.
18:36:17
shka_
Xach: btw, can you take a look and say if it displays fine? https://sirherrbatka.github.io/cl-data-structures/l_1.html#812753871995231275
20:14:09
dlowe
is there a library or implementation feature that allows for asserting that only one reference is held to a particular object?
20:16:07
Bike
dlowe: kind of hard to define, or to know that it's true given everything that happens under the hood
20:16:28
Bike
for example, if you write a defmethod, machinery is gonna keep the original arguments around for (call-next-method)
20:17:32
dlowe
if it's hard for a function, it's even harder for the poor human trying to figure it out
20:21:47
dlowe
so a gc in its reaping or copying phase comes across something that really-should-be-garbage but isn't, it can signal an error or comething
20:27:44
phoe
I don't know if I can use this tool properly though and if it does what I think it does
20:56:39
mseddon
dlowe, I appreciate your pain, and thanks for both your and phoe's insight into observing this
20:59:19
mseddon
Please do report back how complete it's coverage is. It's at least conservatively great.
21:01:46
dlowe
mseddon: I would have to manually add (garbagify <object>) calls everywhere to figure out coverage
21:05:39
phoe
an error, what do you mean? that you want to signal an error if a given object is alive?
21:06:41
phoe
a minor issue is that the SBCL GC runs in the C world, you'll need to jump back to Lisp... which will be troublesome because the world is stopped during GC
2:41:31
Alfr_
dbotton, even (defconstant foo 12) (setf foo 13) doesn't need to trigger an error. It's only undefined behavior.
2:42:33
aeth
implementations are afaik permitted to add a (declare (whatever foo)) if they wanted to
2:48:00
dbotton
is there a reason why the standard felt the need for a deconstant but not on a local basis?
2:48:11
aeth
I don't think there's a way, but (declare) is valid so if you had to do (let ((x 1)) (declare #+your-cl (immutable x)) (setq x 10)) you could still write perfectly portable code here.
2:49:22
aeth
(and I think they're supposed to ignore unrecognized forms inside of DECLARE, so I think but am not sure, that that would just be a warning if you didn't do that)
2:51:51
aeth
Anyway, that's probably my guess as to why it's not in the standard. Because they probably anticipated that they didn't create an exhaustive list of useful declarations
2:59:09
aeth
dbotton: Sorry, what I mean is I don't think there was a particular need to include this in the standard since it gave implementations the power to add it, and they probably weren't really thinkinng about this sort of thing 30 years ago.
3:00:16
aeth
dbotton: You could also, yourself, create a macro that does this without even code-walking, since DEFCONSTANT exists. Just symbol-macrolet
3:02:11
aeth
dbotton: So I guess there is a way to mark a variable as a constant if you're willing to have a hidden DEFCONSTANT variable
3:10:20
aeth
dbotton: probably depends on the implementation because it says it's undefined in the spec, but it's an error in SBCL. e.g. (defconstant +foo+ 42) (defun foobar () (symbol-macrolet ((foo +foo+)) (setf foo 43)))
3:15:29
aeth
it solves the specific problem, but not the general problem, so maybe it's good enough depending on the task
3:20:24
aeth
dbotton: Sorry, I realize I didn't directly answer your question. It's a compile time error because it's an error when I DEFUN, which won't call the code directly
3:26:10
Bike
not really. the compiler can just determine if a variable is immutable by looking at how many places it's assigned.
3:27:51
aeth
the symbol-macrolet to a defconstant should produce the same code in an optimizing compiler (SBCL at the very least)
3:28:42
aeth
If you want more, you'd want an immutable type so it can be optimized outside of a function's scope, too.
3:38:10
dbotton
I have not yes started on clos, so sorry if this is ignorant, would it be possible to extend a built in type and then declare type it on the new type?
3:39:36
aeth
The thing itself always has a type, and the binding can have a type if DECLAREd (technically, it always has it, but it's normally T).
3:40:28
aeth
So the type declaration doesn't have an impact on the object itself, except that it might error if it mismatches (and it might not... only CHECK-TYPE guarantees the type error)
3:42:54
dbotton
I realize this is probably the wrong though process to start with for Lisp, ie trying to type the variable not the data
3:43:03
aeth
For the other part of your question, afaik, you normally can't extend built-in types, but sometimes you can, such as trivial-gray-streams or trivial-extensible-sequences
3:43:43
beach
dbotton: I think you are right. It is common for people coming from other languages to overuse type declarations.
3:44:12
aeth
Generally, type declarations should only matter if for arrays/vectors, numbers, and arrays/vectors of numbers
3:44:36
aeth
At least as far as performance is concerned. Otherwise, the added checks might actually deoptimize the code.
3:45:15
beach
dbotton: I read somewhere that languages with manifest typing force the programmer to come up with types that may not be true later on in the development process.