try/case/catch

15 views
Skip to first unread message

Feng Hou

unread,
Nov 3, 2015, 11:36:36 PM11/3/15
to Lisp Flavoured Erlang
Hi Rebort,

I noticed some inconsistent syntax doc in  https://github.com/rvirding/lfe/blob/develop/doc/user_guide.txt

(try
e
{{(case ((pat {{(when e ...)}} ... )
... ))}}
{{(catch
(((tuple type value ignore) {{(when e ...)}}
- Must be tuple of length 3 here!
... )
... )}}
{{(after ... )}})

First, in the case clause, there are two open parens (underscored), but standalone case is

(case e
(pat {{(when e ...)}} ...)
... ))

It seems case clause in try also only take one leading paren, e.g. (case ('ok..)) (of course, list/tuple patterns would have its own open paren). 

Second, the catch clause (the 2nd underscore) has 3 open parens in the doc, but compiler actually only accepts 2. 

Third, case doc seems have an exact close paren at the end (this is easily caught by lfe-mode).

Are they simply typos? The try construct has the most complex syntax, and counting number of parens according the doc is the first thing when I got a compiler error :) Other new comers might make the same mistake, so I thought it's good idea to mention or/and fix the typos.

Regards,
Feng

Feng Hou

unread,
Nov 3, 2015, 11:38:19 PM11/3/15
to Lisp Flavoured Erlang
Sorry, please disregard the third point.
Reply all
Reply to author
Forward
0 new messages