# enum question

**URL:** <https://forum.kx.com/t/enum-question/11371>\
**Category:** Community Support\
**Tags:** kdb-and-q\
**Created:** [November 25, 2016, 3:44am UTC](https://forum.kx.com/t/enum-question/11371 "2016-11-25T03:44:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![User7](https://avatars.discourse-cdn.com/v4/letter/u/7ea924/32.png) [@User7](https://forum.kx.com/u/User7)\
**Post date:** [November 25, 2016, 3:44am UTC](https://forum.kx.com/t/enum-question/11371/1 "2016-11-25T03:44:00Z")

</div>

ll:“1 2 3 1 2 3 1 2 3”

k)ul:(“1”;“2”;“3”)

`ul$ll /type error

ul$ll /length error

Can enums be done with non symbol lists ?

---

<div class="post-metadata">

**Author:** ![AquaQMatt](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@AquaQMatt](https://forum.kx.com/u/AquaQMatt)\
**Post date:** [November 25, 2016, 8:19am UTC](https://forum.kx.com/t/enum-question/11371/2 "2016-11-25T08:19:00Z")

</div>

Hi,

Is this perhaps similar to what you’re looking for? **Not** using the build in enum (e:`x$y)

q)ll

“1 2 3 1 2 3 1 2 3”

q)ul

“123”

q)show e:ul?ssr[ll;" “;”"] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(ssr to remove the blank space from the string, if you want this enumed then you can keep it in)

0 1 2 0 1 2 0 1 2

Regards,  
Matt

---

<div class="post-metadata">

**Author:** ![effbiae](https://avatars.discourse-cdn.com/v4/letter/e/ecae2f/32.png) [@effbiae](https://forum.kx.com/u/effbiae)\
**Post date:** [November 25, 2016, 8:32am UTC](https://forum.kx.com/t/enum-question/11371/3 "2016-11-25T08:32:00Z")

</div>

if it’s just a char, you could use the same char as it’s “code” (1byte + overhead) - do you gain much by enumerating at all?

of course, for arbitrary lists, you need a strategy, eg for strings, `$ and enumerate
