# What about an \`undefs\` function in \`Base\`?

**URL:** <https://discourse.julialang.org/t/what-about-an-undefs-function-in-base/92690>\
**Category:** General Usage\
**Tags:** feature-request\
**Created:** [January 9, 2023, 2:18am UTC](https://discourse.julialang.org/t/what-about-an-undefs-function-in-base/92690 "2023-01-09T02:18:50Z")\
**Posts on this page:** 1\
**Showing post:** 59

<div class="post-metadata">

**Author:** ![uniment](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/uniment/32/24532_2.png) [@uniment](https://discourse.julialang.org/u/uniment)\
**Post date:** [January 19, 2023, 8:44am UTC](https://discourse.julialang.org/t/what-about-an-undefs-function-in-base/92690/59 "2023-01-19T08:44:19Z")

</div>

Is there a syntax for array comprehensions of different array types, such as `CuArray`? Maybe such a thing would diminish the need for pre-allocation and `for` loops to begin with. Something like this, perhaps?

```julia
Type{CuArray{Int}}[i*j for i=1:2, j=1:2]

```

It’s not consistent with the `ElType[...]` syntax we’re accustomed to, but StaticArrays already broke that expectation with `SA[...]`. It’s nice that `Type{...}` doesn’t provide any constructors, so it wouldn’t break anything.

---

_[View the full topic](https://discourse.julialang.org/t/what-about-an-undefs-function-in-base/92690)._
