str_item and other syntactic elements with Nils are not very usable #5387
Original bug ID: 5387
<:str_item< let x = 1 >> currently represents the following data structure:
The phrase is not parsed as one str_item but a list of str_items. This makes it impossible to use <:str_item< .. >> as a constructor/pattern for one single str_item.
I do not know what is the best solution, but Jake Donham has seen the same issue and written a nice blog entry. It contains a workaround: http://ambassadortothecomputers.blogspot.com/2010/03/reading-camlp4-part-5-filters.html
The text was updated successfully, but these errors were encountered:
Comment author: furuse
Some more info. For example, the following pattern
never matches with code like:
Since the former is StSem(.., StNil ..) but the latter lacks StNil.