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

#5351 2012-06-02 19:44:00

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

coolhogs wrote:

I meant when it gets done.

Ah, okay.  I still don't really understand all these apps that are really just web pages -- although if it were totally local to your computer and had access to its filesystem and hardware, that'd be worth doing.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#5352 2012-06-03 04:44:55

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

Re: BYOB 3 - Discussion Thread

I suggest the chromeless project, it allows you to embed webpages in a custom browser, and call the API from javascript, that means you can open local files etc.
Cross-platform, stand alone app  smile

Offline

 

#5353 2012-06-03 06:30:43

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

Hmm, maybe you could let others submit their ideas?

You don't like it?   sad   Sure, by all means.

...

No offense intended; but I did notice you simply cropped the image in your sig.  tongue

I was hoping for Alonzo the Gobo to make a comeback...

Ah. So I do have to code a special form for lambda, I thought so.

I found out one big mistake I was making—I was first evaluating arguments, than the actual procedure. I should have been evaluating the procedure, and the procedure's evaluation script called "evaluate" recursively on arguments which need evaluation. Does that make sense?

The first thing you do is look at the expression's first element, without evaluating it!  If it's a keyword "lambda" "define" "if" etc, then you go off and evaluate each kind of special form with its own rules.  No part of a lambda expression is evaluated, but (e.g.) IF immediately evaluates the second element, then decides whether to evaluate the third or the fourth, depending on the value of the second.  If that first element isn't a keyword, then you evaluate everything -- doesn't matter what order.

The value of a lambda expression is essentially (list exp env), combining the expression itself with the defining environment, but in practice it's usual to add a procedure type-tag to that, so you can't later confuse it with a user-generated list.

Note: After typing this out, I noticed the next paragraph is a rather brutal rant, so skim it over if you don't have the mental energy.  smile

So how do I go about representing an environment? As a dictionary? If so, when evaluating a lambda I'd have to pass in a copy of the environment to make sure input variables don't leak into the global variables... but I'm not sure how to copy dictionaries so that they remain mutable (Objective C distinguished between mutable and immutable data, which is really silly in my opinion; everything should be mutable and copyable) and all members are copied, too. It's one of those things I hate about Objective-C. It seems to be specially designed to send you to the developer documentation, where the answer is hopelessly buried in optimizations, exceptions, compiler directives, subclassing notes, and deprecations...  sad  Why do we, for example, have to declare the return type of a method (along with the types of inputs)? The compiler should just assume we know what we're doing and pass along whatever value we input/output. There is a "general" value type called "id" but it only works for pointers to instances of classes, so you cannot return a number. Not to mention we have to also copy method declarations into the header for no apparently good reason. They reside outside the instance variable declarations, which is silly because a method is like an instance variable with a lambda value. But of course Obj-C doesn't support lambda, it supports "blocks" whose return type is inferred from return statements, so if you try to return an item of an array somewhere, you won't be able to return an integer somewhere else, even if the item of the array was a number (why do we distinguish between int and float anyway?). And there is no Block type, so returning a block is close to impossible.

Okay, rant over. I'm doing my interpreter over in JS, which is so much nicer to me.  smile

P.S. You can make a long dash with shift-alt-dash, I notice you're putting in double-dashes (--).  wink


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#5354 2012-06-03 07:24:21

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Block request:
imgpaste.com/v1kt.gif


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#5355 2012-06-03 07:43:31

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

Re: BYOB 3 - Discussion Thread

Hardmath123 wrote:

Block request:
imgpaste.com/v1kt.gif

probably not going to be implemented - what would you do with a lambda script that broadcasts in the hat block → infinite loop  tongue
and it's just so easy to workaround, so probably not...

also, it requires evaluating of all broadcast hat blocks while broadcasting. think of speed consequences
just use if/else and a variable  tongue

Offline

 

#5356 2012-06-03 10:18:58

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Hardmath123 wrote:

No offense intended; but I did notice you simply cropped the image in your sig.  tongue

I was hoping for Alonzo the Gobo to make a comeback...

None taken.  Alonzo would be good too.  Maybe just the lambda part of Alonzo, like the sprite icon in BYOB?  PS I didn't crop my sig, I cropped the logo (which is also used in my sig  smile ), which I really love.  I should have done a better cropping job, though; that was a quick response to your favicon request.

So how do I go about representing an environment?

Leaving out the stuff about Objective-C (which does have the virtue of being better than C++, but otherwise it's just one of those yucky languages, like Java, etc.), here's how you make an environment: it's a list of frames, in which each frame is a (mutable) dictionary.  Different environments can include the same frame (for example, they all include the global frame); new environments are made by consing a new frame in front of an existing environment (namely, the environment inside a procedure object when that procedure is called).

P.S. You can make a long dash with shift-alt-dash, I notice you're putting in double-dashes (--).  wink

I never trust that those non-ASCII characters will come out the same on PCs as they do on my Mac.  hmm   I guess now that they invented Unicode I should relax about it, but it used to be just ad hoc nonstandard sets of pseudo-ASCII characters in the 128-255 range.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#5357 2012-06-03 10:26:51

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

roijac wrote:

I suggest the chromeless project

Oh, that looks wonderful!  GPL, cross-platform, the works.  Thanks!


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#5358 2012-06-03 10:33:25

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

roijac wrote:

Hardmath123 wrote:

Block request:
imgpaste.com/v1kt.gif

also, it requires evaluating of all broadcast hat blocks while broadcasting. think of speed consequences
just use if/else and a variable  tongue

We were thinking about something a little different, namely hat blocks with upvars, so instead of evaluating a global variable whenever a broadcast happens, your script would activate on every broadcast, and you could examine the variable's value within your script to find out which message was broadcast and then decide what to do about it.  This idea started because I want the corresponding WHEN (key) PRESSED that activates on every keypress.  Jens says the big implementation problem would be whether we have to turn the hat blocks into C-shaped blocks.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#5359 2012-06-04 04:05:25

xly
Scratcher
Registered: 2010-04-17
Posts: 100+

Re: BYOB 3 - Discussion Thread

Hardmath123 wrote:

Block request:
imgpaste.com/v1kt.gif

I just remark that BROADCAST , contrarily to its sister instruction WHEN I RECEIVED accepts a variable as input. This is convenient if you need to trigger an action to a group of sprites, whose number is variable You just have to read a list and trigger the BROADCAST of each item of the list.

Offline

 

#5360 2012-06-04 06:27:55

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

roijac wrote:

Hardmath123 wrote:

Block request:
imgpaste.com/v1kt.gif

also, it requires evaluating of all broadcast hat blocks while broadcasting. think of speed consequences
just use if/else and a variable  tongue

We were thinking about something a little different, namely hat blocks with upvars, so instead of evaluating a global variable whenever a broadcast happens, your script would activate on every broadcast, and you could examine the variable's value within your script to find out which message was broadcast and then decide what to do about it.  This idea started because I want the corresponding WHEN (key) PRESSED that activates on every keypress.  Jens says the big implementation problem would be whether we have to turn the hat blocks into C-shaped blocks.

...

That thing on the image I pasted is an upvar... sorry about the bad graphics, I'm not an artist.  tongue


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#5361 2012-06-04 07:29:01

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Hardmath123 wrote:

That thing on the image I pasted is an upvar... sorry about the bad graphics, I'm not an artist.  tongue

Ah, sorry, roijac and I both misinterpreted it as a variable reference.  In that case we are in agreement.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#5362 2012-06-04 12:14:53

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Hardmath123 wrote:

bharvey wrote:

roijac wrote:


also, it requires evaluating of all broadcast hat blocks while broadcasting. think of speed consequences
just use if/else and a variable  tongue

We were thinking about something a little different, namely hat blocks with upvars, so instead of evaluating a global variable whenever a broadcast happens, your script would activate on every broadcast, and you could examine the variable's value within your script to find out which message was broadcast and then decide what to do about it.  This idea started because I want the corresponding WHEN (key) PRESSED that activates on every keypress.  Jens says the big implementation problem would be whether we have to turn the hat blocks into C-shaped blocks.

...

That thing on the image I pasted is an upvar... sorry about the bad graphics, I'm not an artist.  tongue

Can't you do that with the scratchblocks tag?

when i receive (something)


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#5363 2012-06-04 12:27:43

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

Hardmath123 wrote:

(which reminds me, you need a favicon urgently).  big_smile

http://snap.berkeley.edu/favicon.png

Uh, you know favicons are supposed to be 32x32, preferably 16x16?

Offline

 

#5364 2012-06-04 17:54:32

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

scimonster wrote:

Uh, you know favicons are supposed to be 32x32, preferably 16x16?

Oh, fussy, fussy....

http://snap.berkeley.edu/favicon.png

or maybe

http://snap.berkeley.edu/fav2.png

Last edited by bharvey (2012-06-04 19:16:32)


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#5365 2012-06-04 21:38:36

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

scimonster wrote:

Uh, you know favicons are supposed to be 32x32, preferably 16x16?

Oh, fussy, fussy....

http://snap.berkeley.edu/favicon.png

or maybe

http://snap.berkeley.edu/fav2.png

I like the second.  smile


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#5366 2012-06-05 02:00:38

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

Re: BYOB 3 - Discussion Thread

Hardmath123 wrote:

I like the second.  smile

+1  smile

Offline

 

#5367 2012-06-05 03:56:01

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: BYOB 3 - Discussion Thread

i'm going to write the explicit control evaluator in scratch!


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#5368 2012-06-05 07:29:04

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

joefarebrother wrote:

i'm going to write the explicit control evaluator in scratch!

In Snap!, you mean, I trust.  Scratch doesn't have goto.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#5369 2012-06-05 08:53:41

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: BYOB 3 - Discussion Thread

roijac wrote:

Hardmath123 wrote:

I like the second.  smile

+1  smile

I'd pick the second if it weren't so aliased.


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#5370 2012-06-05 08:55:42

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

Re: BYOB 3 - Discussion Thread

roijac wrote:

Hardmath123 wrote:

I like the second.  smile

+1  smile

+1

Offline

 

#5371 2012-06-05 09:30:46

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Hey, Bharvey, about the quines, didn't you write this one?

Code:

invoke [[x] print (list "invoke :x :x)] [[x] print (list "invoke :x :x)]

tongue

Also, this ought to work, but doesn't:

Code:

((lambda (a) 
   (lambda () (a a))) 
 (lambda (a) 
   (lambda () (a a))))

Last edited by Hardmath123 (2012-06-05 09:30:59)


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#5372 2012-06-05 10:10:51

dreamod
New Scratcher
Registered: 2012-01-22
Posts: 100+

Re: BYOB 3 - Discussion Thread

I just started modifying BYOB, and I've noticed a lot of stuff I haven't noticed before, and I'm VERY impressed by it. I'm adding Image support which can be exchanged through variables, watchers etc, and even an arg morph which I call ImageArgMorph. It looks like a miniature palette and when clicked let's you edit/view the image which is stored in the arg morph. If you want to have this, tell me. I have no problem with letting you use this for BYOB. I love BYOB.

Offline

 

#5373 2012-06-05 10:21:56

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

Re: BYOB 3 - Discussion Thread

dreamod wrote:

I just started modifying BYOB, and I've noticed a lot of stuff I haven't noticed before, and I'm VERY impressed by it. I'm adding Image support which can be exchanged through variables, watchers etc, and even an arg morph which I call ImageArgMorph. It looks like a miniature palette and when clicked let's you edit/view the image which is stored in the arg morph. If you want to have this, tell me. I have no problem with letting you use this for BYOB. I love BYOB.

well, it probably won't work with javascript  tongue

Offline

 

#5374 2012-06-05 10:48:45

dreamod
New Scratcher
Registered: 2012-01-22
Posts: 100+

Re: BYOB 3 - Discussion Thread

roijac wrote:

dreamod wrote:

I just started modifying BYOB, and I've noticed a lot of stuff I haven't noticed before, and I'm VERY impressed by it. I'm adding Image support which can be exchanged through variables, watchers etc, and even an arg morph which I call ImageArgMorph. It looks like a miniature palette and when clicked let's you edit/view the image which is stored in the arg morph. If you want to have this, tell me. I have no problem with letting you use this for BYOB. I love BYOB.

well, it probably won't work with javascript  tongue

oh yeah, that's right, it's being "converted" to javascript. Well I'm still going to make it for my own use and possibly others.

Offline

 

#5375 2012-06-05 11:00:12

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

joefarebrother wrote:

i'm going to write the explicit control evaluator in scratch!

In Snap!, you mean, I trust.  Scratch doesn't have goto.

I'm going to use broadcast as goto.


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

Board footer