{"url":"https://api.github.com/repos/nushell/nushell/issues/3444","repository_url":"https://api.github.com/repos/nushell/nushell","labels_url":"https://api.github.com/repos/nushell/nushell/issues/3444/labels{/name}","comments_url":"https://api.github.com/repos/nushell/nushell/issues/3444/comments","events_url":"https://api.github.com/repos/nushell/nushell/issues/3444/events","html_url":"https://github.com/nushell/nushell/pull/3444","id":895118324,"node_id":"MDExOlB1bGxSZXF1ZXN0NjQ3MzgwNjE0","number":3444,"title":"Add explicit block params","user":{"login":"sophiajt","id":547158,"node_id":"MDQ6VXNlcjU0NzE1OA==","avatar_url":"https://avatars.githubusercontent.com/u/547158?v=4","gravatar_id":"","url":"https://api.github.com/users/sophiajt","html_url":"https://github.com/sophiajt","followers_url":"https://api.github.com/users/sophiajt/followers","following_url":"https://api.github.com/users/sophiajt/following{/other_user}","gists_url":"https://api.github.com/users/sophiajt/gists{/gist_id}","starred_url":"https://api.github.com/users/sophiajt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sophiajt/subscriptions","organizations_url":"https://api.github.com/users/sophiajt/orgs","repos_url":"https://api.github.com/users/sophiajt/repos","events_url":"https://api.github.com/users/sophiajt/events{/privacy}","received_events_url":"https://api.github.com/users/sophiajt/received_events","type":"User","user_view_type":"public","site_admin":false},"labels":[],"state":"closed","locked":false,"assignees":[],"milestone":null,"comments":0,"created_at":"2021-05-19T07:57:10Z","updated_at":"2021-05-19T08:23:50Z","closed_at":"2021-05-19T08:23:46Z","assignee":null,"author_association":"CONTRIBUTOR","issue_field_values":[],"type":null,"active_lock_reason":null,"draft":false,"pull_request":{"url":"https://api.github.com/repos/nushell/nushell/pulls/3444","html_url":"https://github.com/nushell/nushell/pull/3444","diff_url":"https://github.com/nushell/nushell/pull/3444.diff","patch_url":"https://github.com/nushell/nushell/pull/3444.patch","merged_at":"2021-05-19T08:23:45Z"},"body":"This adds explicit block params. These params follow similarly to positional params for definitions.\r\n\r\n```\r\n[1, 2, 3] | each { |x| $x + 100 }\r\n```\r\n\r\nThe indicator is starting with the `|`. We use the pipe because it's familiar to folks coming from other languages and it's currently an invalid starting token.\r\n\r\nYou can optionally add the `$` to the front:\r\n\r\n```\r\n[1, 2, 3] | each { |$x| $x + 100 }\r\n```\r\n\r\nI've gone ahead and fixed dynamic block invocations. This allows blocks to be called in command positions (note that variables in command positions is still an expression rather than a call)\r\n\r\n```\r\n{|x| echo $x} 100\r\n```","closed_by":{"login":"sophiajt","id":547158,"node_id":"MDQ6VXNlcjU0NzE1OA==","avatar_url":"https://avatars.githubusercontent.com/u/547158?v=4","gravatar_id":"","url":"https://api.github.com/users/sophiajt","html_url":"https://github.com/sophiajt","followers_url":"https://api.github.com/users/sophiajt/followers","following_url":"https://api.github.com/users/sophiajt/following{/other_user}","gists_url":"https://api.github.com/users/sophiajt/gists{/gist_id}","starred_url":"https://api.github.com/users/sophiajt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sophiajt/subscriptions","organizations_url":"https://api.github.com/users/sophiajt/orgs","repos_url":"https://api.github.com/users/sophiajt/repos","events_url":"https://api.github.com/users/sophiajt/events{/privacy}","received_events_url":"https://api.github.com/users/sophiajt/received_events","type":"User","user_view_type":"public","site_admin":false},"reactions":{"url":"https://api.github.com/repos/nushell/nushell/issues/3444/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"timeline_url":"https://api.github.com/repos/nushell/nushell/issues/3444/timeline","performed_via_github_app":null,"state_reason":null}