Better HN
topnewbestaskshowjobs
Log inSign up

drakecoffeecake

7 karma · joined May 19, 2015 (11y ago) · 3 submissions

Submissions

comment 11y ago · link · parent

Yep, yep, yep.

You seem to be exactly right.

comment 11y ago · link · parent

I don't think that's much clearer than a lisp equivalent:

    (todo "housework"
        (item (priority high) "Clean the house.")
        (item (priority medium) "Wash the dishes.")
        (item (priority medium) "Buy more soap."))
Yours looks nicer, but if I wanted to operate on your todo there, it's not obvious how just by looking.

With the lisp, it's obvious: There's a list of 5 elements. The last three are 'items', each of which is a list of 3 elements.

The benefit of s-expressions isn't just that they're flexible in what you can write with them, but that they're easy to manipulate programmatically, and their structure is immediately obvious.

comment 11y ago · link · parent

Lisps let you define the semantics and syntax of a form with macros. I would consider the loop macro in CL to have an internal DSL.

--edited