http://www.perlmonks.org?node_id=266002


in reply to Re: Re: Re: Macros, LFSPs and LFMs
in thread Macros, LFSPs and LFMs

His example was Assert( A eq B && C eq D); could fail with a message saying "A equaled B but C did not equal D"

I reckon you could do this relatively easily so long as you put some minor constraints on how you allow the statement to be written. Since Assert knows both the file name and the line from which it was called you could extract the appropriate value etc. Of course there would be limitations to such an approach, such as not being able to use assert statements inside of an eval, but I still think you could get sufficient power. Perl can be hard to parse, but doing it at this level wouldnt be too hard IMO. After all, all you need to do is extract the contents of a balanced delimiter, and we have established tools for that.


---
demerphq

<Elian> And I do take a kind of perverse pleasure in having an OO assembly language...