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

Concept quoting #703

Merged
merged 4 commits into from
Sep 12, 2024
Merged

Concept quoting #703

merged 4 commits into from
Sep 12, 2024

Conversation

glennj
Copy link
Contributor

@glennj glennj commented Aug 27, 2024

I'm using admonitions pretty liberally here, so we won't really see exactly how they get rendered until the PR is merged.

@glennj glennj marked this pull request as draft August 27, 2024 00:27
@glennj glennj requested review from kotp and IsaacG August 27, 2024 00:28
concepts/quoting/introduction.md Outdated Show resolved Hide resolved

~~~~exercism/advanced
<details><summary>
There are lots of details about bracket expressions.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't heard these calls bracket expressions before. I usually call them a character set, though that might be taken from the regex world.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a term I got from Tcl. There doesn't seem to be a consensus, even among regex terminologies:

  • Ruby: character classes -- this I actively want to avoid, since bash calls [:alpha:] a "character class" within a character set.
  • Python regex: a set of characters
  • Python glob: I can't see it described in the glob or fnmatch modules.
  • Perl: File::Glob calls it a character class

I'll change it to "character set". I did a bash mentoring session for acronym where the mentee used IFS=" ,-,_,*,?" so describing it as a set of characters might help with that.

Copy link
Member

@kotp kotp Aug 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Referenced from https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap09.html

The following character class expressions shall be supported in all locales:

[:alnum:]   [:cntrl:]   [:lower:]   [:space:]
[:alpha:]   [:digit:]   [:print:]   [:upper:]
[:blank:]   [:graph:]   [:punct:]   [:xdigit:]

So perhaps "character class expression" to describe [:alpha:].

I see at least this line references them as "character_class".

@glennj
Copy link
Contributor Author

glennj commented Aug 27, 2024

@IsaacG @kotp bigger picture: Does it make sense to talk about Word Splitting and Filename Expansion in the context of Quoting?

@kotp
Copy link
Member

kotp commented Aug 28, 2024

@IsaacG @kotp bigger picture: Does it make sense to talk about Word Splitting and Filename Expansion in the context of Quoting?

I think at least filename expansion. Not sure about word splitting as much as avoiding splitting strings as separate words.

@IsaacG
Copy link
Member

IsaacG commented Aug 28, 2024

@IsaacG @kotp bigger picture: Does it make sense to talk about Word Splitting and Filename Expansion in the context of Quoting?

Seems reasonable to me! Quoting is only needed to avoid word splitting and pattern expansions so they go hand in hand.

Not sure about word splitting as much as avoiding splitting strings as separate words.

Unless I'm missing something, those two are saying the exact same thing.

@glennj glennj marked this pull request as ready for review August 28, 2024 19:57
],
"contributors": [
],
"blurb": "Quoting in bash, and how it interacts with word splitting and filename expansion."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, the word splitting and filename expansion is in the blurb, so we must address these.

@glennj
Copy link
Contributor Author

glennj commented Sep 6, 2024

@kotp have I missed anything that is blocking your approval?

Copy link
Member

@kotp kotp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving (not sure it will count though) with comment.

1 The quick brown fox jumps.
```

However, leaving variables unquoted is not recommended unless you also disable Filename Expansion.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might mention "how to disable" here, or give a reference for further reading.

@glennj glennj merged commit 8ee7dc4 into exercism:main Sep 12, 2024
2 checks passed
@glennj glennj deleted the concept-quoting branch October 7, 2024 19:40
@glennj glennj added x:module/concept Work on Concepts x:type/content Work on content (e.g. exercises, concepts) labels Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x:module/concept Work on Concepts x:type/content Work on content (e.g. exercises, concepts)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants