Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

-1

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Bagne
ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA




Joined: 19 Feb 2003
Posts: 518
Location: Halifax

PostPosted: Sat Nov 27, 2010 7:46 pm    Post subject: -1 Reply with quote

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
View user's profile Send private message
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Sat Nov 27, 2010 9:52 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Sun Nov 28, 2010 12:31 am    Post subject: Reply with quote

Out of all the many things I regret about hamsterspeak, I think the -- operator is the one I regret most :)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Bagne
ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA




Joined: 19 Feb 2003
Posts: 518
Location: Halifax

PostPosted: Sun Nov 28, 2010 5:26 am    Post subject: Reply with quote

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
View user's profile Send private message
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Sun Nov 28, 2010 6:12 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Bagne
ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA




Joined: 19 Feb 2003
Posts: 518
Location: Halifax

PostPosted: Sun Nov 28, 2010 10:35 am    Post subject: Reply with quote

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
View user's profile Send private message
Spoon Weaver




Joined: 18 Nov 2008
Posts: 421
Location: @home

PostPosted: Wed Dec 01, 2010 8:54 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Bagne
ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA




Joined: 19 Feb 2003
Posts: 518
Location: Halifax

PostPosted: Wed Dec 01, 2010 9:26 am    Post subject: Reply with quote

Well, once I substituted
Code:
-1*stuff

with
Code:
0--stuff

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
View user's profile Send private message
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Wed Dec 01, 2010 9:45 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group