[m-users.] Correct use of pragma source_file and #N directives together ?

Sean Charles (emacstheviking) objitsu at gmail.com
Wed Aug 17 20:23:41 AEST 2022


That's explained much better than I did, thank you Tomas! That's exactly it, when 'doing lp' you the author are free to break down the code into as few or as many parts as possible, the code blocks are not meant to be ruled by the syntax of the final language in any way shape or form. If I choose to break down the guts of a predicate into ten named blocks then that should be my choice. I can see this is getting intereesting for me at least!  :D  It's always the small things, and here I was thinking I'd 'almost finished' the tool... Pareto strikes again!

But... the point of the line number is so that should the code not compile, I actually can point the user back to the correct line in the markdown source file, which is the point of the directives in the first place. I do understand it more clearly now thanks to Zoltans previous comments. 

Sean.



> On 17 Aug 2022, at 11:02, Tomas By <tomas at basun.net> wrote:
> 
> On Wed, 17 Aug 2022 11:49:50 +0200, Zoltan Somogyi wrote:
>> [...] your tool will work for any literate program where each clause
>> and directive is contiguous in the source code. This is as it should
>> be: if you think you need to explain one half of a clause separately
>> from its other half, then you probably should create a separate
>> predicate for one half or the other.
> 
> 
> No, it could just be that the procedure is especially complicated or
> interesting, and you want to add some explanation or reference at that
> exact place in the text.
> 
> It could also be that you have several pieces of code, in different
> parts of the program, with some common purpose or context, and you
> want them together in the printed document.
> 
> (But I don't see a need for keeping track of individual line numbers.)
> 
> /Tomas
> _______________________________________________
> users mailing list
> users at lists.mercurylang.org
> https://lists.mercurylang.org/listinfo/users



More information about the users mailing list