> For the complete documentation index, see [llms.txt](https://trizen.gitbook.io/sidef-lang/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trizen.gitbook.io/sidef-lang/syntax_and_semantics/constructs/with.md).

# With

The `with` statement behaves almost like the `if` statement, but instead of testing for trueness, it checks to see if the given argument is not a `nil` value.

```ruby
with (obj) {

}
orwith (obj) {

}
else {

}
```

Same as the `if` statement, it supports capturing of a defined value in a block variable:

```ruby
with (some_function()) { |value|
    say value
}
```
