-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Move away from let-bindings #23
Comments
I'd be ok with this change provided we can coordinate – probably in This begs the question: how would existing 'output' variables be reimplemented (i.e., |
Yes, I will do this on a feature branch. Also I think I should probably release v2 soon and then v3 when merging that branch into |
That sounds good. Can you make sure to ping me again whenever you push that branch? :-) |
Thanks! I've been testing it out, but I'm running into an issue with the following expression: (ghub-get "/authorizations" nil nil nil nil nil nil nil 'basic) Here's my backtrace
The |
Also, a little bit of code review, is this correct? (defun ghub--auth (url username auth)
(encode-coding-string
(if (eq auth 'basic)
(ghub--basic-auth url)
(concat "token "
(if (stringp auth)
auth
(ghub--token url username (and (symbolp auth) auth))))) ;<--
'utf-8)) The third argument of |
Yes. If |
It was fine until the only use of the url-the-string was to convert it into url-the-object. Anyway that is fixed now. Thanks! |
So is |
Yes that is correct. Because the authentication method is now specified using an argument, which we don't want to specify every time we want to use the default method, that method is no longer identified by |
Alright, token creation works pretty well now (as in I can create a token
What was intended here? |
Seems I did not re-test everything after making changes... |
I can confirm your recent changes have fixed the issue, though see my comment 😉 Any idea on when |
Any time now 😉 I am currently finishing up old stuff that is mostly ready but hasn't hit |
There are updates I'd like to make to Magithub, but I need to push some of these ghub+ changes up to do so. This patch allows `ghubp--request' to keep working with the existing version of `ghub' until 0.2 is released (see magit/ghub#23).
When let-bindings were only used to set use another github instance, then it made sense. That was a use-case I knew I had to support but I figured it would be used very little, so I did not want to "pollute" the function signatures. Back then we already also used it to signal
ghub--request
to unpaginate a resource, and that was a bit strange. I think I did it because I did it for the "instance" also, and maybe I felt that was appropriate becauseurl.el
itself makes heavy use of let-bindings.But then more and more new "variables to be let-bound" got added, and now I find this really weird and old-fashioned.
I was experimenting with adding function arguments as an alternative method to request non-default behavior. But that got out of hand quickly - lots of documentation and accidental complexity.
I am now considering to give up let-bindings altogether and to use function arguments exclusively. This would break backward compatibility, but I think now is the time to make such changes.
/cc @vermiculus
The text was updated successfully, but these errors were encountered: