Title: Argument-mode parsing: Why is a subexpression at the start of an unquoted token treated differently than a variable reference? · Issue #3217 · PowerShell/PowerShell · GitHub
Open Graph Title: Argument-mode parsing: Why is a subexpression at the start of an unquoted token treated differently than a variable reference? · Issue #3217 · PowerShell/PowerShell
X Title: Argument-mode parsing: Why is a subexpression at the start of an unquoted token treated differently than a variable reference? · Issue #3217 · PowerShell/PowerShell
Description: This is a primarily a design rationale question: The issue is that the rules are hard to remember, and perhaps knowing why they are the way they are helps with that. If these work: $a = 4 Write-Output $a/H # -> '4/H' Write-Output H/$a # ...
Open Graph Description: This is a primarily a design rationale question: The issue is that the rules are hard to remember, and perhaps knowing why they are the way they are helps with that. If these work: $a = 4 Write-Out...
X Description: This is a primarily a design rationale question: The issue is that the rules are hard to remember, and perhaps knowing why they are the way they are helps with that. If these work: $a = 4 Write-Out...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/3217
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Argument-mode parsing: Why is a subexpression at the start of an unquoted token treated differently than a variable reference?","articleBody":"This is a primarily a design rationale question:\r\n\r\nThe issue is that the rules are hard to remember, and perhaps knowing _why_ they are the way they are helps with that.\r\n\r\nIf these work:\r\n\r\n $a = 4\r\n Write-Output $a/H # -> '4/H'\r\n Write-Output H/$a # -> 'H/4'\r\n Write-Output H/$(2 + 2) # -> 'H/4'\r\n\r\nwhy shouldn't `Write-Output $(2 + 2)/H` expand to `'4/H'` too, instead of being treated as _2_ arguments, `4` and `'/H'`?\r\n\r\nWhy is a subexpression at the start treated differently than a variable reference?\r\n\r\nAlso, why is `Write-Output .$HOME` treated as _2_ arguments (only happens if the `.` is directly followed by a `$`)?\r\n\r\nFor a full discussion, please see [this Stack Overflow question](http://stackoverflow.com/q/42100211/45375).\r\n","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2017-02-27T18:33:40Z","url":"https://github.com/PowerShell/PowerShell/issues/3217"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:860ff350-2891-65d8-d4cf-9b67bf74345c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9D36:266BB:26E9C46:3634F3B:6AFD47F7 |
| html-safe-nonce | b4b8c24f3603b9bdbbe4a5926324b5607d362009d3f4653551b58750dccdd20a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RDM2OjI2NkJCOjI2RTlDNDY6MzYzNEYzQjo2QUZENDdGNyIsInZpc2l0b3JfaWQiOiI3NjAwNzUyODkzMzcyNDgzNTc2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 703fdf39b7f2e109a01f525e592d0432e073e75f91cadde032d91cf5d2724394 |
| hovercard-subject-tag | issue:210567991 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/3217/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2969959f828b00c267ef39de107d0fd71db39ca33321713455616a0862bf5119/PowerShell/PowerShell/issues/3217 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2969959f828b00c267ef39de107d0fd71db39ca33321713455616a0862bf5119/PowerShell/PowerShell/issues/3217 |
| og:image:alt | This is a primarily a design rationale question: The issue is that the rules are hard to remember, and perhaps knowing why they are the way they are helps with that. If these work: $a = 4 Write-Out... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mklement0 |
| hostname | github.com |
| expected-hostname | github.com |
| None | bdbacc25b921224ff0befcb9e629560a1255be51aec9991d6e3f95b5e9151474 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 556dd37bb0aceffb25724e151b5d858b3265b40b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width