you'll see that items is a table, as declared by "(with (items (table)...", used to store items loaded from file. The definition of an item is found closer to the top in the "(deftem item" block
3) The bang operater a!b is equivalent to (a 'b) and is used as a shorthand for table lookup.
3) The bang operater a!b is equivalent to (a 'b) and is used as a shorthand for table lookup.
But there are many instances it has been used on single symbols like !id. How do I interpret that?
EDIT: I found out! !id is only used with compare, so this is applied to the body like (items!story items!poll). But my problem still exits, how do I find out the story is a local post or a one with url.
But my problem still exits, how do I find out the story is a local post or a one with url.
You mean whether it's a topic with a URL and no text or a topic with text and no URL, right? Hmm, it looks like 'item-page is responsible for displaying the /item?id=... URL, and that calls 'display-item-text to display the textual content of the post. The implementation of 'display-item-text looks like this:
(def display-item-text (s user)
(when (and (cansee user s)
(in s!type 'story 'poll)
(blank s!url)
(~blank s!text))
(spacerow 2)
(row "" s!text)))
So it seems stories have both URLs and text internally, but the text is never displayed unless (blank s!url). That's probably the test you're looking for.