# Do-Block Syntax with Where Keyword

**URL:** <https://discourse.julialang.org/t/do-block-syntax-with-where-keyword/115131>\
**Category:** General Usage\
**Tags:** finalization\
**Created:** [June 3, 2024, 5:14pm UTC](https://discourse.julialang.org/t/do-block-syntax-with-where-keyword/115131 "2024-06-03T17:14:56Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![sgaure](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sgaure/32/14779_2.png) [@sgaure](https://discourse.julialang.org/u/sgaure)\
**Post date:** [June 6, 2024, 7:57am UTC](https://discourse.julialang.org/t/do-block-syntax-with-where-keyword/115131/16 "2024-06-06T07:57:18Z")

</div>

I figured out it’s a two-liner in `JuliaSyntax/src/parser.jl` to support `where` clauses in `do`, provided the argument list is enclosed in parentheses.

```julia
2308c2308,2309
< emit(ps, m, K"tuple")
---
> k = peek_behind(ps, position(ps)).kind
> k != K"where" && emit(ps, m, K"tuple")

```

Then you can do things like:

```julia
julia> foreach([1,2.0,"foo", false]) do (x::T) where T; println(T); end
Int64
Float64
String
Bool

```

I haven’t got the time to follow up a PR, but please do anyone.

---

_[View the full topic](https://discourse.julialang.org/t/do-block-syntax-with-where-keyword/115131)._
