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

Question mark '?' char in a string #64

Open
Bost opened this issue Dec 14, 2019 · 3 comments
Open

Question mark '?' char in a string #64

Bost opened this issue Dec 14, 2019 · 3 comments

Comments

@Bost
Copy link

Bost commented Dec 14, 2019

IMO the special meaning of the question mark character '?' in racket should be ignored if it occurs in a string:

> echo "hello ? where are you?"

16:19 /home/bost/
> echo hello '? where are you'?
hello ? where are you ?
16:19 /home/bost/
> echo "hello '? where are you'?"

16:19 /home/bost/
> echo '"hello '? where are you'?"
hello '? where are you'?
16:20 /home/bost/
> echo '"hello ? where are you?"
hello ? where are you?
16:20 /home/bost/
> 

And also there should be no blanks inserted between the question marks:

> echo hey '?'?'?
hey ? ? ?
16:22 /home/bost/
> 

And at last but not least:

> echo ???
/home/bost/bin /home/bost/dec /home/bost/dev /home/bost/env /home/bost/foo /home/bost/txt
16:24 /home/bost/
>

Thanx.

@willghatch
Copy link
Owner

willghatch commented Dec 17, 2019 via email

@Bost
Copy link
Author

Bost commented Dec 18, 2019

I'm starting to realize the situation around the ? and strings delimited by " / ' or undelimited at all, is complicated in any shell not just in rash. To give you a bit of the context I'm in:
I'm a bash and/or fish-shell user being unhappy with the scripting languages these shells provide. I'm looking for a shell equipped with a syntactically better and semantically more powerful language, preferably a LISP dialect. And I stumbled upon rash and while giving it a try - I found out the very first example from Rash: The Reckless Racket Shell:

[...] The following program works as you would expect.

#lang rash
cd project-directory
echo How many Racket files do we have?
ls *.rkt | wc -l

despite the claim, is not working as I expect. (i.e I was having false expectations)

So maybe it would be enough just to make this "Hello world" example simpler:

#lang rash
cd project-directory
echo "The number of Racket files we have:"
ls *.rkt | wc -l

by not using the ? character and by delimiting the string with " in the echo command, with a reference to the 2.1 quoting globs of your documentation.
And in the '2.1' paragraph of the docs one explains in detail, with examples, the globing problem (as hinted by the TODO) and adds a reference to the 9 Pattern Matching where the meaning of ? is explained.
Thank you.

@willghatch
Copy link
Owner

willghatch commented Dec 18, 2019 via email

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

No branches or pull requests

2 participants