Re: [Flightgear-devel] Flasher in nasal

2007-04-06 Thread Melchior FRANZ
* Melchior FRANZ -- Friday 06 April 2007: > foo.switch(1) ... turn on (or any other value >0) > foo.switch(0) ... turn off > foo.switch(-2) ... turn on for two cycles > > This doesn't break compatibility (who used negative number?), and it even > looks like "up to 2 times", or from 0-2

Re: [Flightgear-devel] Flasher in nasal

2007-04-06 Thread Melchior FRANZ
* Melchior FRANZ -- Friday 06 April 2007: > I think the best way is to interpret the switch() method parameter like so: BTW: I intend to implement that later today, but first I need to fix the tower position, which I've broken yesterday. ;-) m. --

Re: [Flightgear-devel] Flasher in nasal

2007-04-06 Thread Melchior FRANZ
* Roy Vegard Ovesen -- Friday 06 April 2007: > I assumed that it was possible to name the arguments when calling the > function, like in Python. And that you could then give them in arbitrary > order. No, that's not the case in Nasal. > How do I add a argument to the aircraft.light.new meth

Re: [Flightgear-devel] Flasher in nasal

2007-04-06 Thread Roy Vegard Ovesen
On Friday 06 April 2007 19:53, Melchior FRANZ wrote: > Simpler, yes, though not much. What the code does is similar to > overloading in C++. Two possible argument sets to the same function. > Named args alone wouldn't help here at all. What would help is named > args with default values. But that o

Re: [Flightgear-devel] Flasher in nasal

2007-04-06 Thread Melchior FRANZ
* Roy Vegard Ovesen -- Friday 06 April 2007: > As far as I can see the aircraft.light class loops through the > pattern forever. Yes, until it's turned off. Then the loop is actually stopped and doesn't consume any cycles. You could let a timer turn the light off after the desired time. > I as

Re: [Flightgear-devel] Flasher in nasal

2007-04-06 Thread Roy Vegard Ovesen
On Friday 06 April 2007 18:28, Melchior FRANZ wrote: > > Why don't you use the sophisticated aircraft.light flasher? > Re-inventing the wheel? :-) Didn't know about that wheel ;-) After playing around with it a bit I see that it does not quite meet the requirements that I have. I need to blink

Re: [Flightgear-devel] Flasher in nasal

2007-04-06 Thread Melchior FRANZ
* Roy Vegard Ovesen -- Friday 06 April 2007: > I'm trying to create a new flasher for the KAP140 autopilot. This is what I > have so far: Why don't you use the sophisticated aircraft.light flasher? Re-inventing the wheel? :-) > NewFlasher.flash = func { [...] > settimer(me.flash, 1.0); >

[Flightgear-devel] Flasher in nasal

2007-04-06 Thread Roy Vegard Ovesen
Hi I'm trying to create a new flasher for the KAP140 autopilot. This is what I have so far: NewFlasher = {}; NewFlasher.new = func { obj = { parents : [NewFlasher], count : 0, times : arg[1], property : arg[0] }; return obj; } NewFlasher.flash = func { if (