Julia has a similar feature that is built on closures. See the "do
notation" in the manual. For example:

```Julia
open("file", "r") do f
    @show readline(f)
end
```

-erik


On Wed, Jun 1, 2016 at 10:18 AM, Femto Trader <[email protected]>
wrote:

> Hello,
>
> Python have a nice concept called "context manager" (see "with" statement)
> http://book.pythontips.com/en/latest/context_managers.html
> With this concept it's quite easy to open a file without having to close
> it.
> Yattag, for example, use this concept to create XML files.
> You just need to use context managers to create opening tags... closing
> tags
> are automatically created.
> So is there a similar concept in Julia.
> If yes, where can I find some doc about it ?
> If not, is there any plan to provide such feature ?
>
> Kind regards
>



-- 
Erik Schnetter <[email protected]>
http://www.perimeterinstitute.ca/personal/eschnetter/

Reply via email to