Skip to content

Chapter 3 Confusing text #39

@avidrucker

Description

@avidrucker

In Chapter 3, there are two examples of code, followed by this text:

This query takes two arguments: $ is the database itself (implicit, if no :in clause is specified) and ?name which presumably will be the name of some actor.

The above query is executed like (q query db "Sylvester Stallone"), where query is the query we just saw, and db is a database value. You can have any number of inputs to a query.

In the above query, the input pattern variable ?name is bound to a scalar - a string in this case. There are four different kinds of input: scalars, tuples, collections and relations.

I find the wording here is confusing, requiring careful re-reading to parse between "The above query" and "In the above query" which refer to, it appears to me (please correct me if I am mistaken!) the two different queries.

I suggest either:

  • labeling the examples "query A" and "query B" to be extra clear
  • refer to examples specifically as "non-reusable query" and "parameterized query", respectively
  • moving the descriptive text to be adjacent to their respective examples (and not interleaved, if this is the case)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions