Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can sly-inspector set object values at point? #377

Open
Ambrevar opened this issue Nov 18, 2020 · 6 comments
Open

Can sly-inspector set object values at point? #377

Ambrevar opened this issue Nov 18, 2020 · 6 comments

Comments

@Ambrevar
Copy link
Contributor

The inspection of an object looks like this:

#<FOO {1003BABF53}>
--------------------
Class: #<STANDARD-CLASS COMMON-LISP-USER::FOO>
--------------------
 Group slots by inheritance [ ]
 Sort slots alphabetically  [X]

All Slots:
[ ]  AGE  = 18
[X]  NAME = "Mr. X"

[set value]  [make unbound]

To change the value of name, I select the slot with [X] then click on [set value].

In some cases it can be a bit annoying, say if you forget to select a slot, then you must unselect all slots, then select the one you forgot.

What about adding a command to set the slot at point? It's probably a more familiar behaviour to many users.

By the way, is there a way to "select all slots" or "unselect all slots"?

Finally, it'd be nice to have a way to set one value to multiple slots.
If we implement the command I suggested previously to set the slot at point, then we could change the behaviour of [set value] to set 1 value to all selected slots.

Thoughts?

@joaotavora
Copy link
Owner

I'm not in love or married to that interface, but it isn't terribly easy to refactor. Not impossible either. I'd think an interface where
the [set value] and [make unbound] buttons appear dynamically would be nicer. On the other hand, while I do use this, I do it seldom enough that I'm personally not thinking of investing any effort here. But you can give it a go. If it's say, ~30 loc or less and/or makes the code clearer, I'm for it, go ahead.

@Ambrevar
Copy link
Contributor Author

Ambrevar commented Nov 19, 2020 via email

@Ambrevar
Copy link
Contributor Author

On a related note, it'd be nice to be able to edit any symbol value, not just class instances.

In particular, this could be very helpful to edit lists.
Say I have

(defvar foo '((a 10) (b 12) (c 19)))

it'd be nice if the inspector would let do stuff like changing the b value to 13.

At first glance we could simply open an "edit" buffer and drop the value of foo in it. The user would edit it, then commit the changes with C-c C-c or similar.

@joaotavora
Copy link
Owner

What if foo's value references unreadable objects?

@Ambrevar
Copy link
Contributor Author

Ambrevar commented Dec 14, 2020 via email

@joaotavora
Copy link
Owner

SLY obviously has presentations, in the inspector, debugger, REPL, trace dialog, etc. But not in the minibuffer or arbitrary buffer. SLIME's presentation don't work "anywhere", as far as I know. Only the REPL. So a new contrib is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants