Closed unhandyandy closed 6 months ago
That macro applies a transformation (the expr) to a phrase, while preserving any blank space at the beginning of the phrase. It's a convenience macro just for lib/cmds.k, not useful elsewhere.
...Tim...
On Fri, May 17, 2024 at 3:04 PM unhandyandy @.***> wrote:
I see this in cmds.k:
define EDITINPLACE(p,expr)
origt=p%(1).time;p.time-=origt;p.length=latest(p);p=expr;p.time+=origt
Is that a macro? I don't think you mentioned macros in the docs.
If so, why do you change certain values of p, and then just replace p by expr?
OK thanks, I missed it in language.html.
And I forgot that since it's a macro, expr
isn't evaluated till runtime. I'm not a real programmer, but I think I get it now.
Btw, let me repeat once again my appreciation and admiration for Keykit - I use it every day.
I see this in cmds.k:
#define EDITINPLACE(p,expr) origt=p%(1).time;p.time-=origt;p.length=latest(p);p=expr;p.time+=origt
Is that a macro? I don't think you mentioned macros in the docs.
If so, why do you change certain values of
p
, and then just replace p byexpr
?