Arc Forumnew | comments | leaders | submitlogin
Unfinished and work-in-progress: Textile for Arc (github.com)
2 points by dpkendal 5184 days ago | 3 comments


2 points by evanrmurphy 5184 days ago | link

One superficial observation: I've noticed you tend not to stack your closing parens. For example, you have:

  (def txt-block (text)
    (flat ; some shorthand features require splicing
      (with (anon? nil ext? nil tag "p" content "")
        (map
          (re-split "\n\n" text)
          txt-html-block
        )
      )
    )
  )
Instead of:

  (def txt-block (text)
    (flat ; some shorthand features require splicing
      (with (anon? nil ext? nil tag "p" content "")
        (map
          (re-split "\n\n" text)
          txt-html-block))))
Of course, you're welcome to format your code however you like. However, you'll notice most people here (and in other lisp communities, I think) would choose the latter. I like it better because it shortens code and most editors make it easy to check who a paren is paired with if you're ever in doubt.

Thanks for sharing your code.

-----

1 point by dpkendal 5182 days ago | link

I've seen the latter style in other people's code, and I do indeed use it for shorter functions with small amounts of indentation. I use BBEdit, which does have a balance option, (Command-B) but I still like to be able to see when something's out of line at a glance with longer functions. I don't mind either style, though.

-----

1 point by dpkendal 5184 days ago | link

This is the beginnings of an implementation of Textile in Arc. The main textile routine is empty; txt-block doesn't work because re-split, despite being in re.arc, doesn't seem to work (at least for me), so the two main working things are txt-html-block, which needs a couple variables to be defined in order to work, and txt-span and friends, which perform the standard span-like substitutions, without attributes as yet. There are probably gotchas in both routines.

-----