View previous topic :: View next topic |
Author |
Message |
Bagne ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA

Joined: 19 Feb 2003 Posts: 518 Location: Halifax
|
Posted: Sat Nov 27, 2010 7:46 pm Post subject: -1 |
|
|
What's the deal with the - symbol?
I'm finding that I can't use "-" anywhere, so instead of writing A := -B, I have to write A := 0--B. _________________ Working on rain and cloud formation |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Sat Nov 27, 2010 9:52 pm Post subject: |
|
|
There is no negation operator. Yes, it totally sucks.
I plan to provide < and > as alternatives to << and >>, but unfortunately I can't replace -- with -.
It may be safe to add - as the negation operator, removing the ability to start a token with -, which I assume noone does. I'll have to think about it a bit more. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Sun Nov 28, 2010 12:31 am Post subject: |
|
|
Out of all the many things I regret about hamsterspeak, I think the -- operator is the one I regret most :) |
|
Back to top |
|
 |
Bagne ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA

Joined: 19 Feb 2003 Posts: 518 Location: Halifax
|
Posted: Sun Nov 28, 2010 5:26 am Post subject: |
|
|
Wow, take that, -1.
The worst part is that hspeak accepts "-1", but doesn't interpret it correctly.
I had an equation that started with "stuff := -1* ..." and although it successfully compiled, it would get zeroed out on me. _________________ Working on rain and cloud formation |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Sun Nov 28, 2010 6:12 am Post subject: |
|
|
What? Negative numbers are supported (where the - is part of the literal rather than an operator). Maybe you found a bug; if you can reproduce it I'd like to know. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Bagne ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA

Joined: 19 Feb 2003 Posts: 518 Location: Halifax
|
Posted: Sun Nov 28, 2010 10:35 am Post subject: |
|
|
Euh ... maybe I can ... it was buried in layers of code ... but if I can do it again in a simple way, I'll let you know. _________________ Working on rain and cloud formation |
|
Back to top |
|
 |
Spoon Weaver

Joined: 18 Nov 2008 Posts: 421 Location: @home
|
Posted: Wed Dec 01, 2010 8:54 am Post subject: |
|
|
Wait what!?
I know for a fact that I've used negative numbers before! I think it was in Star Wohr. Though, i suppose it could have been the cause of some of the bugs in that game...
..oh noes. |
|
Back to top |
|
 |
Bagne ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA

Joined: 19 Feb 2003 Posts: 518 Location: Halifax
|
Posted: Wed Dec 01, 2010 9:26 am Post subject: |
|
|
Well, once I substituted
with
my script worked :-S
I've used "-1" before too, (and it worked), but in this instance it didn't.
I haven't always been coding in OS X though ... Linux and Windows denote end-of-line in different ways ... might this also be the case for "-"? _________________ Working on rain and cloud formation |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Wed Dec 01, 2010 9:45 am Post subject: |
|
|
line endings are the only difference between linux/windows text files. There are no differences with any other characters.
I cannot reproduce this with a simple test case
Code: |
include, plotscr.hsd
script, foo, begin
variable(bar)
show value(-1*bar)
end
|
I couldn't even guess what may have caused your problem.
However, it is indeed a known malfeature that you can't do this:
Code: |
include, plotscr.hsd
script, foo, begin
variable(bar)
show value(-bar)
end
|
because you will get this error:
Code: |
Semicompiling m.hss to m.hs
reading m.hss
including plotscr.hsd
1566 lines read from 2 files
preliminary pass
parsing top-level
compiling scripts....................................................................................................................................
ERROR: in script foo on line 5 in m.hss
show value(-bar)
^
Unrecognised name -bar. It has not been defined as script, constant,
variable, or anything else
|
|
|
Back to top |
|
 |
|