# 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:** 62

<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 20, 2023, 3:58am UTC](https://discourse.julialang.org/t/what-about-an-undefs-function-in-base/92690/62 "2023-01-20T03:58:40Z")

</div>

Funny that `SA` doesn’t work with comprehensions.

```julia
julia> SA[1, 2, 3]
3-element SVector{3, Int64} with indices SOneTo(3):
 1
 2
 3

julia> SA[x for x=1:3]
ERROR: MethodError: Cannot `convert` an object of type
  Int64 to an object of type
  SA

```

So for comprehensions, you have to use the macro? Sidenote, the space between the macrocall and the brackets is optional:

```julia
julia> SArray[@SArray[1,2,3] for _=1:4]
4-element Vector{SArray}:
 [1, 2, 3]
 [1, 2, 3]
 [1, 2, 3]
 [1, 2, 3]

julia> @SArray[@SArray[1,2,3] for _=1:4]
4-element SVector{4, SVector{3, Int64}} with indices SOneTo(4):
 [1, 2, 3]
 [1, 2, 3]
 [1, 2, 3]
 [1, 2, 3]

```

---

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