This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2009-08-29 21:10:48

BoltBait
Scratcher
Registered: 2009-03-09
Posts: 1000+

Online OR block and short-circuit evaluation

I have not verified this yet, but I think the OR block of the online player is not doing short-circuit evaluation.  But, I think the offline player does.

For example, if I give the script:

<set{ X  }to( 5  }>
<if> << <(  <{X  }> <=> 5 )>   <or> <( <{ Item [ X ] of MyList  }> <=> TEST  )>  >>

Causes a problem for the online player if MyList does not have 5 elements in it.  But, I believe the offline player handles it just fine.

This could be another way to detect if you are online vs. offline... at least until the bug is fixed.  wink

Last edited by BoltBait (2009-08-29 21:27:15)


Animated sigs must be banned!
http://boltbait.com/j.pnghttp://boltbait.com/s.pnghttp://boltbait.com/d.pnghttp://boltbait.com/a.pnghttp://boltbait.com/p.png

Offline

 

#2 2012-09-23 04:12:48

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: Online OR block and short-circuit evaluation

Necropost, but since no one ever posted the answer, I'll answer for future scratchers.

This is not about short-circuiting, which isn't supported at all, but about error handling; Scratch 1.4 ignores errors, but the flash/java players don't.

Offline

 

#3 2012-09-23 15:06:01

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Online OR block and short-circuit evaluation

roijac wrote:

Necropost, but since no one ever posted the answer, I'll answer for future scratchers.

it's still a necropost even though you admit it  hmm

Last edited by Wes64 (2012-09-23 15:06:22)


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#4 2012-09-23 15:28:17

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Online OR block and short-circuit evaluation

Wes64 wrote:

roijac wrote:

Necropost, but since no one ever posted the answer, I'll answer for future scratchers.

it's still a necropost even though you admit it  hmm

It's not necessarily bad though.

As roijac said, it's a thing with error handling. There's probably a way to create short-circuit evaluation yourself though.

Offline

 

#5 2012-09-23 16:18:06

BoltBait
Scratcher
Registered: 2009-03-09
Posts: 1000+

Re: Online OR block and short-circuit evaluation

I would like Scratch to support short circuit evaluations.  Most languages do.


Animated sigs must be banned!
http://boltbait.com/j.pnghttp://boltbait.com/s.pnghttp://boltbait.com/d.pnghttp://boltbait.com/a.pnghttp://boltbait.com/p.png

Offline

 

#6 2012-09-27 18:09:57

3sal2
Scratcher
Registered: 2012-03-22
Posts: 100+

Re: Online OR block and short-circuit evaluation

Squeak, as well as related languages, use eager evaluation.


http://scratch.mit.edu/static/projects/3sal2/3120946_sm.png In 2012, scientists at the LHC discovered the Higgs boson, which explains the source of the masses of the W+, W-, and Z bosons, as well as fermions.

Offline

 

Board footer