"comprehension" seems like an awkward word choice

In Julia, an item like:
[ xx for x in 1:5 ]
is called a “comprehension” and results in a Vector as in:
julia> [x
x for x in 1:5]
5-element Vector{Int64}:
1
4
9
16
25

Not even sure what the word “comprehension” means except for
“something that is or can be comprehended”. Maybe?
I think what was needed is a word that means
“to assemble multiple pieces into a larger item” like maybe
• conglomeration
• amalgamation
• compilation
• composition
• accumulation

“List comprehension” has been used since 1977. It’s not specific to Julia.

12 Likes

The word “comprehensive” means “includes lots of things”, as in “a comprehensive study of..” so the word is quite suitable.

5 Likes

Thanks for looking into it and providing the info. Oddly, the word “comprehension” means “understanding things” and carries no connotations of including things as
does the word comprehensive.
Seems like comprehensive and comprehension are two words like “allusion” and “illusion” – they sound similar and are spelled similarly but actually have no relation to each other. That might be what led us down this path.

comprehensive and comprehension seem to share some Latin roots. not obvious, but not unreasonable word choice.

It comes from set builder notation, which is also called ‘set comprehension’. The word comphrension indeed came from Latin, in the dictionary it says ‘to bind together, unite’. Seems like a fitting name!

2 Likes

According to another free dictionary the noun “comprehension” can mean:

1. the act or capacity of understanding
2. the state of including or comprising something; comprehensiveness
...

The 2nd meaning seems to be relevant here.

The word came out of the muddy waters of set theory’s birth a hundred years ago or more. Though, nowadays it’s more usual to call it “separation” or “replacement”, depending on … things.

3 Likes

If it makes you feel any better, you could try mentally replacing the word “comprehension” with the phrase “collected generator” everywhere. That’s exactly what comprehensions are in Julia — and the latter matches our typical English language usages much more closely.

3 Likes

In Latin languages (Portuguese, Spanish, Italian and French at least), “comprehend” can mean both “understand” or, less frequently, “contain”. Oddly, I think in none of them “comprehension” is used with the container meaning.

(just a curiosity).

1 Like

In Portuguese, the second meaning of compreensão is “the ability to contain within oneself, in one’s nature, or in a category, in a system.”

1 Like

Never heard anyone using it in that context :smile:. We do use “compreender” in the sense of containing, but “compreensão”, honestly, never seen it.

1 Like

I agree that the verb with the same origin is routinely used to also mean to include, while the noun has that meaning in more technical contexts, such as set theory.

1 Like

Welcome (the OP) to the world of mathematics, where words sometimes have specialized and unintuitive meanings :wink:

2 Likes

In the online Oxford, the meaning you are referring to (" the state of including or comprising something; comprehensiveness ") is marked as “archaic”
(like: thee, thou, and methinks).

COMPREHENSION

=============

  1. the action or capability of understanding something.

“some won’t have the least comprehension of what I’m trying to do”

Similar:

understanding

ability to understand

grasp

grip

conception

apprehension

cognition

cognizance

ken

knowledge

awareness

perception

discernment

interpretation

Opposite:

ignorance

incomprehension

  1. ARCHAIC

inclusion.

Methinks it might encourage the acceptance of Julia if the words made sense to those not trained in the use of archaic verbage. ((Just trying to help))

Using the term comprehension doesn’t seem to have had too severe consequences to the acceptance of Python, so I think Julia can cope.

8 Likes