# Conversion?

**URL:** https://discourse.julialang.org/t/conversion/10421
**Category:** General Usage
**Created:** [April 18, 2018, 9:29pm UTC](https://discourse.julialang.org/t/conversion/10421 "2018-04-18T21:29:22Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![iwelch](https://avatars.discourse-cdn.com/v4/letter/i/8c91f0/32.png) [@iwelch](https://discourse.julialang.org/u/iwelch)
#### Post date: [April 18, 2018, 9:29pm UTC](https://discourse.julialang.org/t/conversion/10421/1 "2018-04-18T21:29:22Z")

</div>

Dear J experts: Trying to understand conversions and promotions. How would one set an autoconversion so that a Bool-eable type becomes Bool when Bool is requested. I.e., that the following would work?

```julia
if (1) "ok" end

```

`convert(Bool, 1)` already works, but it is not invoked. Why does the 1 not get converted to a Boolean on request of a Bool? This is _not_ important. I just want to learn whether this is a core facility that I am not aware of, or simply better not done.

(I understand the promotion rule of `[1, true]` sensibly yields `[1,1]`.)

---

<div class="post-metadata">

### Author: ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)
#### Post date: [April 18, 2018, 10:27pm UTC](https://discourse.julialang.org/t/conversion/10421/2 "2018-04-18T22:27:56Z")

</div>

That’s not allowed.
