-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
Handling URLs #35
Comments
Yeah, I've thought about allowing single colons inside symbols. I've also thought about removing the '@' operator (but keeping splice) and changing backtick to automatically splice. Doing that would allow URLs and email addresses to be entered without quotes. This would also mean that variadic methods would have to have a space following the colon in their parameter list. (Something I have not been consistent about). The drawback is a more complicated syntax with one more special case which is something oh has tried hard to avoid. |
I think it's worth pointing out that URLs have to be quoted in BASH and probably any shell. URLs are common, but they also complex and they utilize a large number of special characters. |
I'm wondering if it's possible to build a sufficiently smart completer so that quotes can be added (suggested?) when they are needed in order to keep oh keystroke competitive without complicating oh as a language. |
I've been playing around with ways to reduce the differences between what needs to be quoted in oh vs other shells. In retrospect, I think The current plan is to replace
we would write:
Using The Expressions of the form:
we would write:
These changes will allow colons to appear unquoted. The splice operator |
URLs get parsed as commands (i.e.
protocol://blahblah
is interpreted asprotocol (//blahblah)
), which is a bit awkward when writing curl/git/ssh/scp commands. Is it reasonable to parse something like 'http://blahblahblah' as a symbol, and only make it a command when there's a space following the colon? i.e. 'http: //blahblahblah' uses a command called HTTP.Alternatively, URLs could be matched as their own data type (which might be nice since oh has a stronger type system than most shells). Or the ':' shorthand could be replaced with another symbol like '$' a la ocaml or '@' a la haskell (though it would still have to be surrounded with spaces since scp/mail use
@
)?I know that you can wrap it in quotes to make it a string, but URLs are extremely prevalent in shell commands, so wrapping them all in quotes can get tedious.
The text was updated successfully, but these errors were encountered: