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

edit:del-var would be useful #1265

Closed
zzamboni opened this issue Mar 15, 2021 · 7 comments · Fixed by #1629
Closed

edit:del-var would be useful #1265

zzamboni opened this issue Mar 15, 2021 · 7 comments · Fixed by #1629

Comments

@zzamboni
Copy link
Contributor

I think it would be useful go have an edit:del-var, analogous to edit:add-var, to remove a variable from the interactive scope.

For me, a specific use case would be to undefine aliases in the current session. At the moment this can be done by redefining the alias variable to a function that calls the corresponding external command (see https://github.com/zzamboni/elvish-modules/blob/master/alias.elv#L95), but it seems just being able to remove the variable would be cleaner.

@supreetsingh10
Copy link
Contributor

Can I work on this one? I think I can implement this.

@krader1961
Copy link
Contributor

@supreetsingh10: No need to ask permission. In general, for open source projects like Elvish it is sufficient to simply say "I'm going to work on this issue." And a lot of the time even that isn't needed. Having said that, I think you are underestimating the difficulty of this problem relative to your knowledge of Elvish and Go. Take a look at any of my pending pull requests such as PR #1270. All of those address an issue that is no more complicated than this issue. If you understand those changes you might be successful at implementing this feature.

@krader1961
Copy link
Contributor

@supreetsingh10: Take a look at PR #1221 which has been abandoned by its author. Given the feedback in that PR you should be able to create a new PR that correctly fixes the problem.

@supreetsingh10
Copy link
Contributor

Thank you for the guidance. That is true, I need to get more skilled before I tackle these problems. Thank you Mr. @krader1961.

@supreetsingh10
Copy link
Contributor

supreetsingh10 commented Apr 30, 2021

Mr. @krader1961 I think I have got this problem figured out. I have written some code, it is not enough to be pushed, so I am posting my doubts here, you can reply to them when you have time.

Since I am working on edit:del-var, I am currently in the working in vars.go and I have written and the function delVars(), it is linking with the shell and running. I am using the addVar() to understand how this thing works. I want to ask that am I supposed to add eval.DeleteVarFromName() thing in closure,go as there is a function called MakeVarFromName(), which is making a variable in edit:add-var(), in vars.go. Is there a free() function which I have to use to ````delete a variable```.

@krader1961
Copy link
Contributor

@supreetsingh10: Without doing my own investigation of the relevant code I have no idea what the answers are to your questions. This is something you will need to figure out on your own. It is why I have been gently suggesting you try solving easier issues for your initial set of changes. A change that affects the behavior of the eval package is, almost by definition, going to need a good understanding of Elvish internals. Something someone new to the project is unlikely to have.

@supreetsingh10
Copy link
Contributor

Mr. @krader1961, your feedbacks and guidance are very important to me, I have been following everything you said, I am also learning Elvish from the guide available. You have asked me to work on simpler things, it is just I have a habit of tinkering with things, that is why I started working on this. Anyway, I will drop this thing for a while and look for a simpler issue. I think elvish is really cool, I just want to learn as much as I can from this project and experienced people who have made this. I am sorry if you felt that I did not listen to you, you helped me throughout the file module, I am very grateful for that.

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

Successfully merging a pull request may close this issue.

4 participants