# \#keyword

**URL:** https://forum.elixirforum.com/tag/keyword/198.md

[Latest](https://forum.elixirforum.com/latest.md) · [Categories](https://forum.elixirforum.com/categories.md) · [Tags](https://forum.elixirforum.com/tags.md)

---

## [Keyword inside tuple shorthand syntax {a: 1, b: 2}](https://forum.elixirforum.com/t/keyword-inside-tuple-shorthand-syntax-a-1-b-2/63960)

<div class="topic-metadata">

**Author:** [@bartblast](https://forum.elixirforum.com/u/bartblast)\
**Replies:** 16\
**Last updated:** [June 5, 2024, 5:01pm UTC](https://forum.elixirforum.com/t/keyword-inside-tuple-shorthand-syntax-a-1-b-2/63960 "2024-06-05T17:01:10Z")

</div>

This could resolve to {\[a: 1, b: 2\]}. Was it ever considered to allow such syntax? Notice this: {:abc, a: 1, b: 2} and this: my\_fun(:abc, a: 1, b: 2) work as I described. As I understand, the compiler is able to figure o…

---

## [Kword - A library of keyword-list handling functions to complement Keyword](https://forum.elixirforum.com/t/kword-a-library-of-keyword-list-handling-functions-to-complement-keyword/62246)

<div class="topic-metadata">

**Author:** [@spacebat](https://forum.elixirforum.com/u/spacebat)\
**Replies:** 19\
**Last updated:** [March 19, 2024, 11:04am UTC](https://forum.elixirforum.com/t/kword-a-library-of-keyword-list-handling-functions-to-complement-keyword/62246 "2024-03-19T11:04:36Z")

</div>

A recent Reddit post Keyword.get Considered Harmful nudged me to tidy up and publish a small utility library that I’ve been using to deal with keyword lists in an ergonomic way. Elixir keyword lists as a common represe…

---

## [Is there a way to get Keyword in key is String and not atom?](https://forum.elixirforum.com/t/is-there-a-way-to-get-keyword-in-key-is-string-and-not-atom/53083)

<div class="topic-metadata">

**Author:** [@Fl4m3Ph03n1x](https://forum.elixirforum.com/u/Fl4m3Ph03n1x)\
**Replies:** 2\
**Last updated:** [January 10, 2023, 10:03am UTC](https://forum.elixirforum.com/t/is-there-a-way-to-get-keyword-in-key-is-string-and-not-atom/53083 "2023-01-10T10:03:52Z")

</div>

Background I have a Keywords list I got from HTTPoison that looks like this: \[ {"Date", "Tue, 10 Jan 2023 09:47:09 GMT"}, {"Content-Type", "text/html; charset=utf-8"}, {"Transfer-En…

---

## [Storing Keyword lists in json(b) (?) column](https://forum.elixirforum.com/t/storing-keyword-lists-in-json-b-column/50161)

<div class="topic-metadata">

**Author:** [@silverdr](https://forum.elixirforum.com/u/silverdr)\
**Replies:** 6\
**Last updated:** [September 12, 2022, 5:56pm UTC](https://forum.elixirforum.com/t/storing-keyword-lists-in-json-b-column/50161 "2022-09-12T17:56:55Z")

</div>

In “the other language” for an already long time one can rely on the order of key-value pairs in the Map equivalent so getting keys returns them in the order the data structure was created so I never had problems seriali…

---

## [How can I analyse Data(keywords) in Elixir?](https://forum.elixirforum.com/t/how-can-i-analyse-data-keywords-in-elixir/35645)

<div class="topic-metadata">

**Author:** [@MihailPertsev](https://forum.elixirforum.com/u/MihailPertsev)\
**Replies:** 13\
**Last updated:** [January 16, 2021, 3:43pm UTC](https://forum.elixirforum.com/t/how-can-i-analyse-data-keywords-in-elixir/35645 "2021-01-16T15:43:17Z")

</div>

Hi there! I have a tough understanding what to do: I need to categorize a product by it’s keywords. I have a several “Topics”, for example: “New Technologies”, “Health”. Each of those “Topics” have several “Subtopics…

---

## [Keyword.fetch vs bracket access \[\]](https://forum.elixirforum.com/t/keyword-fetch-vs-bracket-access/35849)

<div class="topic-metadata">

**Author:** [@WestKeys](https://forum.elixirforum.com/u/WestKeys)\
**Replies:** 1\
**Last updated:** [November 28, 2020, 9:31pm UTC](https://forum.elixirforum.com/t/keyword-fetch-vs-bracket-access/35849 "2020-11-28T21:31:55Z")

</div>

Hi everyone, I’m currently going through the Getting Started and I have encountered the following: defmodule KV.Registry do use GenServer def start\_link(opts) do # 1. Pass the name to GenServer's init serv…

---

## [Why keyword lists for opts instead of maps?](https://forum.elixirforum.com/t/why-keyword-lists-for-opts-instead-of-maps/29654)

<div class="topic-metadata">

**Author:** [@fireproofsocks](https://forum.elixirforum.com/u/fireproofsocks)\
**Replies:** 13\
**Last updated:** [March 9, 2020, 6:01am UTC](https://forum.elixirforum.com/t/why-keyword-lists-for-opts-instead-of-maps/29654 "2020-03-09T06:01:45Z")

</div>

I’m sure this has been asked elsewhere (but forgive me I could not find something that addressed this specifically)… Why do Elixir functions usually take keyword lists as options? Why not maps? Keyword lists are proble…

---

## [Macro to create a keyword for ecto3 dynamic bindings](https://forum.elixirforum.com/t/macro-to-create-a-keyword-for-ecto3-dynamic-bindings/26021)

<div class="topic-metadata">

**Author:** [@Meldanor](https://forum.elixirforum.com/u/Meldanor)\
**Replies:** 1\
**Last updated:** [October 12, 2019, 7:41pm UTC](https://forum.elixirforum.com/t/macro-to-create-a-keyword-for-ecto3-dynamic-bindings/26021 "2019-10-12T19:41:00Z")

</div>

How can I use a macro to create a simple keyword to use in a dynamic for Ecto 3? What I want to achieve: dynamic(\[school: e\], ilike(field(e, ^param\_name), ^"%#{param\_value}%")) I tried two versions: defmacro want\_thi…

---

## [Better way to get default option?](https://forum.elixirforum.com/t/better-way-to-get-default-option/25711)

<div class="topic-metadata">

**Author:** [@thojanssens1](https://forum.elixirforum.com/u/thojanssens1)\
**Replies:** 5\
**Last updated:** [September 29, 2019, 12:03pm UTC](https://forum.elixirforum.com/t/better-way-to-get-default-option/25711 "2019-09-29T12:03:25Z")

</div>

I have something like: Keyword.get( opts, :upload\_path\_changer, Application.get\_env( :file\_uploader, :upload\_path\_changer, MyApp.UploadPathChanger ) ) Get the :upload\_path\_changer module from option…

---

## [Is :ok a predefined or reserved keyword in Elixir?](https://forum.elixirforum.com/t/is-ok-a-predefined-or-reserved-keyword-in-elixir/4482)

<div class="topic-metadata">

**Author:** [@vonH](https://forum.elixirforum.com/u/vonH)\
**Replies:** 8\
**Last updated:** [July 5, 2018, 1:50pm UTC](https://forum.elixirforum.com/t/is-ok-a-predefined-or-reserved-keyword-in-elixir/4482 "2018-07-05T13:50:05Z")

</div>

When looking at the elixir-lang docs on tuples iex\> {:ok, "hello"}, tuple = {:ok, "hello"} , I see :ok being introduced out of thin air (unless it is introduced elsewhere), but when I try this sequence iex -S mix c "myf…

---

## [Why is Keyword restricted to atom keys?](https://forum.elixirforum.com/t/why-is-keyword-restricted-to-atom-keys/3150)

<div class="topic-metadata">

**Author:** [@Qqwy](https://forum.elixirforum.com/u/Qqwy)\
**Replies:** 4\
**Last updated:** [January 6, 2017, 4:46pm UTC](https://forum.elixirforum.com/t/why-is-keyword-restricted-to-atom-keys/3150 "2017-01-06T16:46:47Z")

</div>

I am working on an implementation of a forth-like language on top of Elixir. One of the things that is a major part of any forth-like language, is the dictionary of defined functions (called words). This is usually impl…
