roijac wrote:
also, how long do you think it will take till blocks like <%item in %list> or (%n of %list)?
And [add [] to {list}] and [delete () of {list}]
Offline
suggestion:
(length()) instead of (length of ())
<() in ()> instead of <() contains ()>
(() of ()) instead of (item () of ())
(()>) instead of (list()>)
will make scripts MUCH shorter. also you can make length of polymorphic to strings, and <() in ()> could also make string processing easier
Last edited by roijac (2011-11-14 00:48:36)
Offline
Hardmath123 wrote:
Hardmath123 wrote:
An explanation of some abstract BYOB blocks. Please check it out!
^^ This got buried under the list excitement...
I saw this the first time, but I've kind of been putting off replying to it because... I have a couple of disagreements with your explanation, and I was afraid I'd either hurt your feelings or start an argument. But here goes:
1. Explaining the BYOB blocks in terms of Javascript code doesn't really help our intended audience, who aren't JS programmers. If a reader understands the JS "function" notation, then s/he isn't going to have any trouble with THE BLOCK or THE SCRIPT.
2. More seriously, you conflate the creation of a procedure with assignment to a variable: "This is used to set a variable to a script." But the whole point of THE BLOCK and THE SCRIPT is that they make anonymous procedures. Instead of comparing them to
var myScript = function(#1, #2)
you should just compare them to
function(#1, #2)
A typical use would be in conjunction with a higher order function, e.g.,
MAP [THE ... BLOCK] OVER ...
Offline
bharvey wrote:
Hardmath123 wrote:
Hardmath123 wrote:
An explanation of some abstract BYOB blocks. Please check it out!
^^ This got buried under the list excitement...
I saw this the first time, but I've kind of been putting off replying to it because... I have a couple of disagreements with your explanation, and I was afraid I'd either hurt your feelings or start an argument. But here goes:
1. Explaining the BYOB blocks in terms of Javascript code doesn't really help our intended audience, who aren't JS programmers. If a reader understands the JS "function" notation, then s/he isn't going to have any trouble with THE BLOCK or THE SCRIPT.
2. More seriously, you conflate the creation of a procedure with assignment to a variable: "This is used to set a variable to a script." But the whole point of THE BLOCK and THE SCRIPT is that they make anonymous procedures. Instead of comparing them toCode:
var myScript = function(#1, #2)you should just compare them to
Code:
function(#1, #2)A typical use would be in conjunction with a higher order function, e.g.,
MAP [THE ... BLOCK] OVER ...
Don't worry, I'm used to criticism. I knew I would have gotten 75% or more of the material wrong. Hey, that's how you learn!
Anyway, so I chose to explain in terms of JS because many people know JS as document.getElementById().value and alert(). Most 'JavaScripters' I've come across haven't even heard of functions or have no clue what they do. I tried to link them: if you understand the BYOB stuff, you'll learn some new JS. But I guess, in retrospect, you're right.
And I had no clue how a function() would be useful without it set to a variable. I use it only to assign methods to objects or make an array of functions.
So, thanks for the feedback, anyway.
Offline
roijac wrote:
(length()) instead of (length of ())
Part of Scratch's heritage from Smalltalk is that it tries to make its primitive blocks readable rather than short. In this case, I'm not convinced that saving three characters is really worth losing the self-documenting nature of this block. But, you know, you can always write your own synonym!
(()>) instead of (list()>)
I skipped over a couple where the issues are the same as for LENGTH: conciseness vs. self-documentingness. But with LIST, I think your change would be really confusing, because to me a no-name reporter with one slot should mean the identity function, not one that wraps a list around its input. So you are putting a heavy explanatory weight on that arrowhead.
you can make length of polymorphic to strings, and <() in ()> could also make string processing easier
I've thought about that many times. It does seem redundant to have LENGTH and CONTAINS and ITEM/LETTER () OF in both green and red versions. But I feel that way only while writing a script. When I'm reading a script, even one I wrote myself, I like the fact that the block color reminds me what the domain of the function is.
What do other people think?
Offline
bharvey wrote:
I've thought about that many times. It does seem redundant to have LENGTH and CONTAINS and ITEM/LETTER () OF in both green and red versions. But I feel that way only while writing a script. When I'm reading a script, even one I wrote myself, I like the fact that the block color reminds me what the domain of the function is.
the idea is that the script won't care if it's a string or a list, and will handle strings as they were lists of letters
'bout the shorting, that's point of view
Offline
I just downloaded BYOB and think it's amazing. I've run into a problem, though: If you right-click a sprite's thumbnail and clone it, then try to make the clone the parent of the one you cloned, BYOB freezes. I think it's probably an infinite loop. Has anyone ever had this problem?
Offline
Yup, this is how I wanted lists to behave (there have been more optimizations tonight). Please note, that lists should behave much faster than in Scratch/BYOB, but only if you hide the watchers. Then you should be able to work with much larger lists than in Scratch or BYOB.
Offline
The following example shows that Snap! is convenient, stable and faster than Byob for this same application where script blocks are stored into a LIST.
I'm currently using Firefox last version.Aurora.
- Click on C broadcast button to clear the previous shape LISCOM list before starting a new shape.
-Click on brodcast button, N, NE, E, SE etc to move the turtle.
- Click on the Script to redraw the shape.
Offline
roijac wrote:
roijac wrote:
Hardmath123 wrote:
EDIT: Oh, and can you add 25 pixels of blank space under the last block in the frame? It gets blocked by the scrollbar.
not that hard, is it?
Yeah, yeah, we'll get there. That sort of trivial UI tweak isn't high priority pre-alpha. Everything reported here will be fixed in the beta.
Offline
14God wrote:
Are save files going to be cookies?
Not cookies; Javascript has this sandboxed filesystem that's a bit cookie-like but allows bigger files. I'm thinking there will be three options for saving:
1. JS sandbox file.
2. Send to web server (as plain text file).
3. Download an auxiliary program that talks to Snap! via localhost TCP and allows storing to the real filesystem -- sort of a special case of #2 in which the web server runs on your own machine and interfaces to local files.
So, people behind a paranoid firewall can choose either of the first two, and people who trust the software (and the projects they download, which really is an issue) can have the more convenient #3.
Offline
bharvey wrote:
14God wrote:
Are save files going to be cookies?
Not cookies; Javascript has this sandboxed filesystem that's a bit cookie-like but allows bigger files. I'm thinking there will be three options for saving:
1. JS sandbox file.
2. Send to web server (as plain text file).
3. Download an auxiliary program that talks to Snap! via localhost TCP and allows storing to the real filesystem -- sort of a special case of #2 in which the web server runs on your own machine and interfaces to local files.
So, people behind a paranoid firewall can choose either of the first two, and people who trust the software (and the projects they download, which really is an issue) can have the more convenient #3.
Or you could send it to the server and make JS download it and save it to the computer.
Offline
@ bharvey &Jens - I like the Logo.
I've attached an update of this "robdraw" application where the "snap!" shape uses a list of 244 items. I've used extensively this application, with no problem. The responsiveness is satisfying and much better than with Byob.
Offline
Hi Xavier,
Kudos! Once again you're pushing the pre-alpha version's envelope with awesome hacks! I'm really glad that you're designing these tough tests, especially since I've been hard at work optimizing list watchers in the past days (err, nights ).
Thanks for the great contribution!
Offline
MathWizz wrote:
What kind of save format will you use? BYOB's' format or a new format just for Snap! ?
It'll be similar to Scratch 2.0, probably JSON based. But we'll also provide ways to read and convert old projects.
Offline