elixir-plug / plug

Compose web applications with functions
https://hex.pm/packages/plug
Other
2.87k stars 586 forks source link

improper lists usage #1091

Closed Sed9yDataBank closed 2 years ago

Sed9yDataBank commented 2 years ago

👋🏼

I want to understand the reason of constructing an improper list here.

First Question: Is the usage of an improper list necessary here?:

https://github.com/elixir-plug/plug/blob/274e44f9a149b922099bf60029d8267afe494968/lib/plug/conn/query.ex#L256

# encoder fallback
  defp encode_pair(field, value, encoder) do
    [field, ?= | encode_value(value, encoder)]
  end

I think improper lists do not have many uses; also there are many functions that will error when given an improper list

Second Question: why this construct actually exists in Erlang?

josevalim commented 2 years ago

Hi, Can you Please use the ElixirForum for questions/help/feedback, where a wider community will be able to jump in? Thank you!

Sed9yDataBank commented 2 years ago

sure! sorry for budging in like that and thanks