matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 11993
Posted: 08:15am 16 Jan 2025
That would be great. Thanks Geoff.
No: sorry. I'm not prepared to support two development streams. For 6.00.02 I will revert to uploading firmware to the development link on Geoff's site. Edited 2025-01-16 18:19 by matherp
robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2552
Posted: 01:44pm 16 Jan 2025
this also works:
Print double(--a%)
but unfortunately this does not:
Print double(+a%)
my vote would be for +a% for the reasons that:
+ using it adds just a single token to the program's length rather than two tokens,
+ applying the same rule to + as is applied to - would reduce the size of and simplify the interpreter,
+ it is mathematically correct.
one could even argue that the error produced:
> > Print double(+a%) Error: Expression syntax >
represents a... bug. if - is accepted as a valid unary operator that changes sign, then surely +must be accorded the same status, as a unary operator that does not change sign.
as a bug fix, this could even be a good excuse for releasing a new revision of mx170 mmbasic
cheers, rob :-)
addendum: look what works on the mx170:
> > ?+-+2 -2 > ? ---2 -2 > ? +--2 2 > ?--+2 2 >
addendum 2: looks like the code that evaluates expressions for print accepts '+' as a unary operator, but the function parser does not. Edited 2025-01-16 23:58 by robert.rozee
robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2552
Posted: 01:59pm 16 Jan 2025
addendum3: nope, it is that + as a unary operator works on numerics, but not variables Edited 2025-01-17 00:03 by robert.rozee
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 11993
Posted: 02:03pm 16 Jan 2025
Print double(+a%) Error: Expression syntax
Not on a PicoMite, works as expected
robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2552
Posted: 02:05pm 16 Jan 2025
Print double(+a%) Error: Expression syntax
Not on a PicoMite, works as expected
hmmm. it truly is a bug - but just in the mx170 version!
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 11993
Posted: 02:10pm 16 Jan 2025
This also works on the PicoMite
Print double(--++-+a%)
robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2552
Posted: 02:20pm 16 Jan 2025
This also works on the PicoMite
Print double(--++-+a%)
now that's just showing off!!
did a check with 5.05.05 and got the same failure:
[2] Print double(+a%) Error : Expression syntax > > Micromite MKII MMBasic Ver 5.05.05 Copyright 2011-2021 Geoff Graham
>
cheers, rob :-)
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 4405
Posted: 02:28pm 16 Jan 2025
For what it is worth I vaguely recollect the behaviour of the + unary operator being fixed during earlier PicoMite firmware development (and me copying the fix to MMB4L) so the syntax problem may be present on CMM2 + MMB4W depending on whether Peter backported it.
Best wishes,
Tom
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 11993
Posted: 02:40pm 16 Jan 2025
The "fix" was incidental to an optimisation I did on the CMM2 to handle unary operators faster. It is in MMB4W and CMM2
zeitfest Guru Joined: 31/07/2019 Location: AustraliaPosts: 702