It could be very beneficial for debugging. My debugger tends to be a lot of print statements, so something like

.globalconst int DEBUG = 1
.macro IfDebug(level, code)
        unless .level >= DEBUG goto .$endif
        .code
        .local $endif:
.endm

.IfDebug(1,
        print "var = "
        print var
)

would be useful, but nevertheless, pir statements that span multiple lines is just weird to me. I think I'm most surprised about that. Is it odd that I find the fact that it allows multiple lines more surprising than allowing code?

On Dec 11, 2005, at 4:14 AM, Leopold Toetsch wrote:


On Dec 11, 2005, at 0:53, Joshua Isom wrote:

Since it's not documented at all that I've seen, either for or against, I'm wondering what's the arguments to macros are supposed to be. Consider this code.

.sub main :main
    .IfElse(TRUE,
        print "True\n"
    ,
        print "False\n"
    )

This is at least astonishing. The argument lexer obiously just scans for the next comma.

--------------
This will print True, then False, then False. Comma's aren't allowed for any of the statements(and they can be multilined), even commented out ones(which if this "feature" isn't a bug, that part is). By using pir's syntax, a lot of commas are eliminated, so it's at least somewhat of a practical thing. But since I doubt this is at all intended, is it a bug?

Or an undocumented feature. And untested. Dunno if we should keept it.

Joshua

leo


Reply via email to