Re: Tiny typo in Manual

new topic     » goto parent     » topic index » view thread      » older message » newer message
Jim C. Brown said...

I still don't like the syntax. I mean, you can't exactly override immediate_elapsed_time() with a user provided function like you could with peek()

Or can you?

CChris said...

immmediate_time() restarts the stopwatch, so it is a procedure. I say restarts because say common.e would start it, thus allowing to reckon parse time. The backend wuld start its own stopwatch in all cases.

immmediate_elapsed_time() is a function. The "immediate_" part clearly says that it is not a runtime thing. It may not be as useful, but its implementation cost is about nil.

elapsed_time() is a true function, which retrieves immediate_elapsed_time() if it makes sense. That's the trickier part.

Of course, parse time doesn't make sense for bound/translated code. For shrouded code, this would take into account decompression time, and immediate_elapsed_time() would have no effect (it wouldn't be in the IL anyway).

CChris

These would be predefined smbols like peek(), so, syntactically speaking, you can override them like peek().

However, the override will be evaluated at run time only, which is of course mostly useless. This reminds me of something I had thought about for a while: syntax plugins. They would allow to inject code at parse time, which is what you wish override could do in that case. I'll need more time to come up wth something, I currently don't know how I'd implement it. Apart from a nifty sed script on the .e source files, which is not looking good at all.

CChris

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu