mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
Joined: Aug 2007
Posts: 13
I
iStink Offline OP
Pikka bird
OP Offline
Pikka bird
I
Joined: Aug 2007
Posts: 13
It's a good idea to keep mIRC away from making it's language draw away from a C syntax, because it would benifit all who program, that way they don't have to keep on going through different help files and then get mixed up later on.

So to make it simple I believe that it would be better to just keep the language universal.

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
First off, don't kid yourself.. mIRC is nothing like C.

The *only* thing mIRC shares in common with C style syntax is curly braces. Just about nothing else is C inspired. mIRC is untyped for one (let alone dynamically typed), but more specific to syntax: there's no ; command endings, no required (), no strings, no for loops, no arrays, a goto label is ":name" not "name:", functions that return values start with $, functions that dont (optionally) start with /, variables start with %, identifier (not mirc "identifiers") tokens can be any string of non-space characters in mirc, C has it well defined. There's no ON * event handling syntax. Heck, it doesn't even share all the properties of if statements: C doesn't use "elseif". Is that enough difference? If you define a language as C style based on the fact that it uses curly braces, that covers a lot of languages... languages like Tcl, for instance, which mIRC is probably more similar to.. and that language could not be less like C.

Secondly, you talk about getting mixed up-- if mIRC starts adopting C idioms when it hasn't ever done so, that's far more of a mixup to any mIRC scripter than anything else.

If anything, it's a good idea to keep mIRC using the same idioms it already is-- that would confuse no one, because it's consistent.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Dec 2002
Posts: 503
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Dec 2002
Posts: 503
*pets argv[0]*..

There there, take a nap now..

Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
Originally Posted By: argv0
you need to choose an "mircish" approach because the syntax has to be compatible, otherwise you completely destroy the parser...

for instance "case:" is a valid command name and so is "default:", so how would the parser differentiate?

I beg to differ the case and default statement are parts inside the switch() {

}
statement so it could definitely make the distinction without breaking compatibility. mIRC would have to break switch,case & default aliases anyway so whether it breaks default or default: is of little importance.
Originally Posted By: argv0

case N: might work but again, mIRC has no concept of strings, so you could easily end up with
Code:
case X: says: 
   blah

for "X: says"


Since when has that stopped mIRC from implementing anything ? By that logic the whole on *:TEXT:*:*: concept could/should have never been implemented.

The same escape logic would apply to the case statement
"case X $+ $chr(58) says:"


$maybe
Joined: Aug 2007
Posts: 13
I
iStink Offline OP
Pikka bird
OP Offline
Pikka bird
I
Joined: Aug 2007
Posts: 13
Quote:
First off, don't kid yourself.. mIRC is nothing like C.

You are probably right in SOME ways, since nobody's opinion will be the same, let's just end this with: "We agree to disagree."

Quote:
The *only* thing mIRC shares in common with C style syntax is curly braces.

Really? I always thought the syntax was alot like it and when I did, I didn't say all of it was exactly like it... of course! I don't really see why they put ";"'s at the end of every line. I don't see the use for it. It just makes the code look sloppy, and unreadable. (but that's my opinion, one man's junk is anothers treasure.)

Onwards...

I have seen alot of my scripts using a buttload of elseif's just because I needed to make a simple conversion table, or encryption logarithim. My example in words is that if a line starts with '-', then I want it to read the command before processes all the data it gets. So with that said, I need to use $iif or if,elseif,elseif,elseif,elseif,else statements because it is the only way to do it, for now.

Now... if we had case/switch: it would be alot easier.

For the goto loop:
If I wanted to use a goto, I would take 4 hours trying to figure out what was wrong with it then give up and do it the hard way. Right now, I don't feel like absolutely wasting 4 hours of my time when I have a life to live.

For anything else:
Just ask yourself, is there ANYTHING that can have a comeback and make sense to what I'm about to try and debate with?


Quote:
If anything, it's a good idea to keep mIRC using the same idioms it already is-- that would confuse no one, because it's consistent.

Hi there. I have seen almost every good scripting language out there. They all have one thing in common: They all confuse me.
When you talk about confusion, it's inevitable. Why keep everything the way it is and accomplish nothing and be lazy, when you can do something about it, make it better to use, and pretty much delay anything that would make anyone argue?

Personally, I really think that switch would be good for mIRC, because switch in mIRC has no equivalent yet. And another thing: If I posted every suggestion that ran through my mind, you guys would have a huge forum running. But instead, I think about what I'm going to suggest. I look at the quality of my posts, and I think: "Are people [i]really] gonna wanna read this? Or are they going to laugh at me and spit in my face?"

That is the only reason I posted here, so I have data and reason to back anything up that I say, so hit me with your best shot, and may the more experienced or more prepared win.

Point blank: I'm just trying to see what can be done to improve this for everyone, and not just myself.

Thankyou for your time, and if you reply to this and it is off topic, please PM me with it so we can talk privately, because I don't want any more spam on this thread.


PS:
I am sorry for posting something completely off-topic, just needed to clear up some spam.

Joined: Mar 2008
Posts: 93
B
Babel fish
Offline
Babel fish
B
Joined: Mar 2008
Posts: 93
Originally Posted By: Mpdreamz
switch/case,for,foreach still high on my wishlist!


+1

Stopped counting how often I could have needed some for()-like statement, rather than using var %i = <start>, while (%i < <condition>) { <do stuff>, <change> %i }

Greetings, BhaaL

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
CASE isn't the same as FOR. FOR and WHILE are pretty much interchangeable... they basically do the same thing, but are formatted differently. Case is more related to just IF/ELSEIF/ELSE.


Invision Support
#Invision on irc.irchighway.net
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
CASE is also relatively interchangeable except for fallthroughs though fall throughs can be done with nested ifs


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Right. I wasn't meaning it wasn't interchangeable... just not with FOR.


Invision Support
#Invision on irc.irchighway.net
Joined: Aug 2007
Posts: 13
I
iStink Offline OP
Pikka bird
OP Offline
Pikka bird
I
Joined: Aug 2007
Posts: 13
Some people say that it's just the same as using an if statement.
Well; What if you have 40 things you want to check?
Code:
if this { do this
and this
and this 
and this
}

40 times does not seem pleasant.

But, even though using the goto loop, it would just make the code longer and take much more time to parse rather than just doing it.


Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Nobody said it was the same syntactically. Semantically, however, you're doing the same thing with a set of if statements.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Page 2 of 2 1 2

Link Copied to Clipboard