C.W.K.
Stream
Lesson 02 of 04 · published

Smart Albums: Describe the Set

~11 min · smart-albums, declarative, query, multi-membership

Level 0Blank Page
0 XP0/35 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete
"Don't file a drawing in ten folders. Describe the ten folders, and let the drawing show up in whichever ones it belongs to."

One Home, Many Appearances

Every item in Loomis has exactly one real home — the folder it actually lives in. But it can appear in any number of smart albums, and that's not a contradiction, because a smart album isn't a place you put things. It's a query. An item shows up in a smart album not because you dragged it there, but because it matches. One home, unlimited appearances, and not a single copy made.

Membership Is Computed, Not Moved

A smart album like 'all ungraded hand studies tagged difficult' is defined by a predicate — a condition over an item's tags, type, and grade. Any item that satisfies the condition appears in the album, automatically. Tag a brand-new session 'difficult' and it materializes in that album with no drag and no duplication; remove the tag and it quietly leaves. The album is a live view of its query, recomputed as your items change, so it can never fall out of date the way a hand-filed folder does.

Declarative Beats Imperative for Organization

This is the deep distinction. Imperative organization means physically placing each item in each spot it belongs — manual, duplicative, and stale the moment anything changes. Declarative organization means describing the set you want with a query and letting membership be computed. It's the same leap as folders-versus-search, a playlist versus a smart playlist, a table versus a database view. Once your organization is a set of saved queries rather than a pile of manual filings, it maintains itself — the drudgery of keeping ten folders in sync simply evaporates.

Monotone Predicates Stay Legible

Loomis keeps the smart-album predicates monotone: adding a matching item only ever adds it to the album, never silently removes something else. That restraint keeps the mental model dead simple — a smart album is 'everything that matches this query,' full stop, with no spooky action where tagging one thing rearranges others. Predictable, monotone membership is exactly what makes a query-driven system trustworthy instead of mysterious; you always know why an item is in an album, because it's written in the query.

Code

A folder is a move; a smart album is a saved query·python
# A FOLDER is imperative: you MOVE an item into it. Exactly one home per item.
folders[item.home].append(item)         # one real home, chosen by hand

# A SMART ALBUM is declarative: a saved QUERY, not a place you drag things.
ungraded_hard_hands = SmartAlbum(
    predicate=lambda i: i.type == "hand" and not i.graded and "difficult" in i.tags
)

# Membership is COMPUTED on read -- no move, no copy:
contents = [i for i in all_items if ungraded_hard_hands.predicate(i)]

# Tag a NEW item 'difficult' and it appears automatically; untag it and it leaves.
# One item, many computed memberships, zero duplication -- and never out of date.

External links

Exercise

Find something you currently organize by filing items into multiple places — email into several folders, bookmarks into overlapping categories, photos into many albums. Redesign it as one home per item plus saved queries for every cross-cutting view you want. List the maintenance work that disappears, and the one risk that goes away entirely (hint: copies drifting out of sync).
Hint
Manual multi-filing forces you to remember every place an item should go and to update all of them when things change — and copies inevitably diverge. Switching to one-home-plus-queries deletes that whole category of upkeep: membership is derived, so it's always correct by construction, and there are no duplicates to keep consistent because there was only ever one item.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.