Comment

Comment by weinzierl

I had my gripes with LaTeX but the backslash in front of every macro was never one of them. I think it helps not only machine parsing but very much my human visual parsing.

BTW one related trap in LaTeX is if a macro without parameters removes the trailing space from the output. The article mentions this in passing but does not say what Typst's solution is. Do Typst functions always require parentheses?

I'm also confused about the following syntax and especially where the function ends:

    table.header([A], [B]) // This one is clear

    table.header()[A] // Makes sense, [A] turns magically into last param

    table.header()[A][B] // Slightly confusing, why would [B] also belong to the function? But OK.

    table.header()[A] [B] // Totally confusing, why is this an error now?

For the last case: If it is a parameter list a space should not matter, if it is not [B] should not be part of the function and treated as unrelated.
parent weinzierl 1 year ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton