View Single Post
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#34
Originally Posted by austin View Post
But now that I think about it, I might change the overloading handler code in powerlaunch. Instead of only executing the one handler, it could just execute all, unless a special action is called to stop execution. I'll have to think about which case (overriding or chaining) is more common.
I'd vote for current way. Calling it explicitly when it makes sense is easier to understand IMO. It also allows you to call common code before or after your specific one. Or maybe some keyword like 'call super' would be nice so you don't need to know where is parent code.

Originally Posted by austin View Post
About the language, that's kind of funny given how this thread started...In fact, i purposely tried to simplify the core language as much as possible. I didn't want a full language so nested ifs and command blocks will likely never be implemented as it can be implemented in other ways.
Yes, I agree, even if 'other ways' produces spaghetti code which is less straightforward for newbie powerlaunch programmers. Took me a while to figure out how to do basic stuff. But still, cleaner and smaller language is good too.

Originally Posted by austin View Post
Logical expressions are likely to be implemented as I'm thinking of moving all of expr into powerlaunch.
Great. I was thinking about moving 'reading of light sensor lux value and comparing it' into powerlaunch directly but did not know how to implement 'less than five'. And then also found that the sensor is not exported via hal (at least lshal output does not ring a bell with me) so I need filesystem access anyway.

Also negation is quite useful for 'if' if you just need 'else' clause.
Originally Posted by austin View Post
Note that you should be able to use expr to do logical expressions currently like if `expr $foo | $bar` ...
Ah, I see. Will try.
__________________
Newbies click here before posting. Thanks.

If you really need to PM me with troubleshooting question please consider posting it to the forum instead. It is OK to PM me a link to such post then. Thank you.