Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

While Loop bug?

Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
11-23-2008 03:37
From: Johan Laurasia
No No NO. The second method makes reading code MUCH easier
De gustibus non erat disputandum, friend.

I find 1TBS easier to read. You find it harder to read. That doesn't make me right and you wrong, nor does it make you right and me wrong. All that means is you don't care for 1TBS, and that I prefer 1TBS.

It's not like we're programming in Python, Fortran, or other oddball languages where whitespace is semantically meaningful.
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-23-2008 07:45
Taking into account visual acuity and the way our brains are all wired differently, it isn't surprising that we each prefer one or the other indent schemes.

And as for God......... It would kind of suck if there really was one and she was just plain vanilla.

Now for a bit of Physics trivia. By now, everyone on the planet knows of the Large Hadron Collider. Many have heard of some of the more far fetched theories surrounding it such as that when it is running it will create a black hole which will destroy the earth. But I bet most don't know just exactly what the LHC is looking for? They hope to prove the existence of Higgs boson, otherwise known as the God Particle!!!!

_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-23-2008 07:56
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
11-23-2008 08:29
I've got a good friend who is an IPU believer (Invisible Pink Unicorn - It's a faith based on faith and logic, faith - that IPU is pink, logic - since IPU can't be seen that it must be invisible).

Theologians have been discussing the recent entrance of FSM on the scene and trying to decide if it qualifies as a religion (on grounds that it is an anti-religion; should the belief that FSM is possible be considered a religion?).

FSM (Flying Spaghetti Monster) was first created in a satirical letter written to a school board that was considering including ID (Intelligent Design) in it's science curriculum (he was requesting equal time for FSM as ID was with Evolution).
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
11-23-2008 08:36
From: Argent Stonecutter

I find 1TBS easier to read. You find it harder to read. That doesn't make me right and you wrong, nor does it make you right and me wrong. All that means is you don't care for 1TBS, and that I prefer 1TBS.

I see this thread will not die, so I will have my say too:)
Before anybody even dreamed about C, Java or LSL, ALGOL used the reserved words: 'begin' and 'end' like we use '{' and '}', the compiler does not care and since the compiler does not care about indentation anybody is free to write source code to her own taste;)
_____________________
From Studio Dora
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
11-23-2008 09:58
From: Dora Gustafson
I see this thread will not die, so I will have my say too:)
Before anybody even dreamed about C, Java or LSL, ALGOL used the reserved words: 'begin' and 'end' like we use '{' and '}', the compiler does not care and since the compiler does not care about indentation anybody is free to write source code to her own taste;)
Just a wee little nitpick...

There are no reserved words in Algol. The Algol "begin" and "end" are tokens, and how the compiler distinguishes between the words "begin" and "end" as tokens and any other use of them is an implementation detail. In the report these tokens are underlined. The Burroughs implementation of Algol introduced the terminology of "reserved words" in uppercase, and some implementations used delimiters like quotes to indicate these tokens, but the only reference to reserved "anything" in the report is to a subset of mathematical functions that were assumed to be universally available.
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore
Tyken Hightower
Automagical
Join date: 15 Feb 2006
Posts: 472
11-23-2008 11:14
From: Argent Stonecutter
Just a wee little nitpick...

There are no reserved words in Algol. The Algol "begin" and "end" are tokens, and how the compiler distinguishes between the words "begin" and "end" as tokens and any other use of them is an implementation detail. In the report these tokens are underlined. The Burroughs implementation of Algol introduced the terminology of "reserved words" in uppercase, and some implementations used delimiters like quotes to indicate these tokens, but the only reference to reserved "anything" in the report is to a subset of mathematical functions that were assumed to be universally available.

*foams at the mouth*
_____________________
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
11-23-2008 12:37
just for fun, I'll disagree with johan on a small point

to the begining coder, there is no visual difference between
function( blah_blah_blah )
and
flow_control( blah_blah_blah )

yes you and I know flow gets brackets, and functions dont (except the user defined ones that confuse them all the more... and this is why you get semicolons popping up after flow controls... not because of the semantics of what they do, but because of the visual structure of how they're written.

forcing the use of 1tbs eliminates this in part, because most beginers at least understand that brackets contain control code, and visually you NEVER see a semicolon following a bracket.

now differences in training and habit abound, if you're taught to look for open braces on theier own line to start a block, then anything else will throw you, if you're taught to look for the tab to deliniate that, the previous provides a visual break that is the equivalent of a stop sign on a freeway.

in all of this the goal should should be a method that makes the code both easy to read, but also prevents semantic errors as much as possible (variables on the right in comparisons, is a good example), or at the very least makes them easier to detect on debugs.

misplaced semicolons are one of the hardest mistakes to catch with a quick visual scan... because the visual structure is the same. (missing ones are a bit easier). howvever mising or mismatched braces are probably the second (IMO) but occur more frequently. so both styles have their merit in this regard.

I suppose it comes down to which portion you prefer to go deeper than the visual on, and really at this level, whether you prefer to look for an absence or a presence of something on that key structure.... namely the presence of a bracket, or the absense of a semicolon.

you prefer the latter, I prefer the former... it's not a huge deal ... really
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
11-24-2008 03:07
From: Tyken Hightower
*foams at the mouth*

In what language is "if if then then; else else;" legal and meaningful?
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-24-2008 04:52
From: Argent Stonecutter
In what language is "if if then then; else else;" legal and meaningful?

http://hactar.net/stutter/
:cool:
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
11-24-2008 05:09
From: Jesse Barnett

Sorry, that would get you:

ERROR SE_UNDEF: Variable 'THEN;' has no value at stdin:1

Or:

ERROR SE_UNDEF: Variable ';' has no value at stdin:1

Depending on how it tokenizes.
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-24-2008 05:19
From: Argent Stonecutter
Sorry, that would get you:

ERROR SE_UNDEF: Variable 'THEN;' has no value at stdin:1

Or:

ERROR SE_UNDEF: Variable ';' has no value at stdin:1

Depending on how it tokenizes.

Yep but the name was appropriate.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
11-24-2008 12:04
assuming you killed that first semicolon the structure would be fine... little lacking in content though.... 3 points for jesse knowing of stutter, 2 for argent for actually parsing it
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
11-24-2008 12:21
From: Void Singer
assuming you killed that first semicolon the structure would be fine... little lacking in content though.... 3 points for jesse knowing of stutter, 2 for argent for actually parsing it
Of course, neither you nor Jesse identified the language I was referring to as PL/I.
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
11-24-2008 13:33
And 4 points for Strife for not getting involved =^_^=
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
11-24-2008 13:44
I still think they should have based LSL on Forth.

key owner

vocabulary default
default definitions
: state_entry llGetOwner owner ! ;
: on_rez llGetOwner owner @ != if llResetScript then ;
( ... )
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-24-2008 13:51
From: Argent Stonecutter
Of course, neither you nor Jesse identified the language I was referring to as PL/I.

Nope I didn't because I don't know how to spell PL/I either.

Actually I was surprised as heck when I did a Google search for coding language, stutter and it popped up. It being a Lisp variant was just icing on the cake.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
11-24-2008 17:34
From: Argent Stonecutter
I still think they should have based LSL on Forth.


should have based it on lua, no ; or {}, just an end every once in a while

(oh yea and all those pesky .: then do and some of the worst noob formating ive ever seen, looks like code does here on the forums without a plugin)

oh! i figured it out too, god is just a compiler (runs like hell)
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
11-24-2008 21:10
From: Osgeld Barmy
oh! i figured it out too, god is just a compiler (runs like hell)

does that make the programmer more or less powerful? and at any rate, who wrote the compiler? >=)
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
11-24-2008 21:52
From: Argent Stonecutter
I still think they should have based LSL on Forth.
That would be nice. It's a very flexible and powerful language compared to LSL. Don't have a case (switch) statement? Just write one.

Of course we'd have gotten a weird Forth with a list instead of a stack and no push pop drop or roll operators, or maybe each stacklist operation would have a 3 second delay built in, or something like that.
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-
Jeredin Denimore
Romani Ite Domum
Join date: 5 Jul 2008
Posts: 95
11-25-2008 06:00
From: Osgeld Barmy
...oldschool lsl script writers...


I'd contribute but I'm still giggling at the above...
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
11-25-2008 07:14
From: Osgeld Barmy
should have based it on lua
Too big and complex. Needs to be something simple, like Forth or Lisp/Scheme.

(key owner)

(state default
(state_entry (lambda nil
(set 'owner (llGetOwner)))
(on_rez (lambda (p)
(cond
((eq owner (llGetOwner)) nil)
(t (llResetScript))))
; ...
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
11-25-2008 07:38
oh god, not LISP (or a derivative). You thought new users had problems now. LSL at least tells you when your types don't match. LISP is a great and powerful language but that power comes at a great cost, you don't know you have done something heinously wrong until you run the code and encounter the bugged section. The only way to be sure things are working properly is to write tests for all functionality; when you're new to a language, that is a huge burden (you don't know what you can depend on, you don't know the limitations).

That was my experience working in ERLANG at least. I still thought it was an interesting language don't get me wrong, it just was a very rude awakening to have to do something I was used to the compiler doing, and the frustration of trying to track down exactly what was expected of me (At the time I was writing a plug-in for Wings3D).

Oh and when I saw your Forth sample code my initial reaction was "Oh Hell No, take thy RPN back to the pit of Hades from which you dragged it". In retrospect, it looks like a nice way to express the LSO bytecode. Which is not a good thing. Reading LSO bytecode is not particularly fun however it is expressed, neither is writing it.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
11-25-2008 08:31
From: Strife Onizuka
oh god, not LISP (or a derivative).
I knew I could troll you eventually. :)

When I saw the LSO bytecode the first thing *I* thought was "I really ought to write a Forth front end to this". Too late now, of course.
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore
1 2 3