bharvey wrote:
blob8108 wrote:
I might need a superclass for both Script and Comment (for free-floating comments), as they're both things that can be added to the scripting area. Any thoughts?
Since comments can be attached to scripts, I've always thought of free-floating comments as being attached to empty scripts. A comment is just another kind of block that connects sideways instead of vertically.
But a comment is attached to a specific block, not a script. So then I'd have to have a Script with a kind of "null" block, which has a comment attribute.
Block("say [Hello!] for (2) secs"), rather than the uglier Block('say:duration:elapsed:from:', 'Hello!', 2).
Yes of course that's way better!
But then the Block constructor has to use the parser, and the parser becomes an integral part of Kurt.
Snap! scripts are basically "nested tuples with the command name as the first item", the same as Scratch, right? (Is "S-expressions" the technical term?)
I think you mean "Snap! instructions" not "Snap! scripts"...
Gah, ask a stupid question
I meant a block is an S-expression, yeah. And then a list of blocks is a stack; a script is a stack; and stacks can be arguments to other blocks...
I like your explanation, but I don't get
Snap! wouldn't be written yet, so I don't get a vote.
And my question remains: are Snap!'s script data structures easily converted to Scratch-like ones, or not?
Offline
Also, anyone feel like making a quick 1.4 insert-to-2.0 insert Python dictionary?
EDIT: whoops, broken link
Last edited by blob8108 (2013-03-31 18:34:01)
Offline
blob8108 wrote:
And then a list of blocks is a stack; a script is a stack; and stacks can be arguments to other blocks...
I've never liked the Scratch use of the word "stack" for a script, because it has a totally different meaning in non-Scratch CS circles.
I like your explanation, but I don't get
Snap! wouldn't be written yet, so I don't get a vote.
Oh, you know, Jens is an amazing programmer who turns out vast quantities of (working!) code in no time, so who am I to tell him how to do it? I'm a mediocre programmer who's been lucky enough to sit at the feet of giants. I just argue about the features and the UI.
And my question remains: are Snap!'s script data structures easily converted to Scratch-like ones, or not?
Umm, well, as you point out, at a certain level of abstraction it's all S-expressions. (As for any language!) But saved Scratch (1.4) projects aren't text files, unlike Snap! ones. On the third hand, the primitives are largely the same, and so is the way blocks fit into other blocks. Except, of course, on the fourth hand, for procedures as data.
So, yes and no.
Offline
bharvey wrote:
blob8108 wrote:
And then a list of blocks is a stack; a script is a stack; and stacks can be arguments to other blocks...
I've never liked the Scratch use of the word "stack" for a script, because it has a totally different meaning in non-Scratch CS circles.
Yeah, good point. I'll try and avoid that.
And my question remains: are Snap!'s script data structures easily converted to Scratch-like ones, or not?
Umm, well, as you point out, at a certain level of abstraction it's all S-expressions. (As for any language!) But saved Scratch (1.4) projects aren't text files, unlike Snap! ones. On the third hand, the primitives are largely the same, and so is the way blocks fit into other blocks. Except, of course, on the fourth hand, for procedures as data.
We're assuming I've parsed the XML/JSON/objtable/whatever. What differences are there in the way the blocks fit together?
Basically, if I have a Block class that works like this:
>>> block = kurt.Block('say:duration:elapsed:from:', 'Hello!', 2)
>>> block.command
'say:duration:elapsed:from:'
>>> block.args
['Hello!', 2]
and a script class:
class Script(object):
pos = (10, 10)
"""(x, y) position from the top-left of the script area in pixels."""
blocks = []
"""the list of Blocks."""
Is that flexible enough to store Snap! scripts?
(pseudo-Python for brevity)
EDIT: hahaha, beat teh confuzzifier
Last edited by blob8108 (2013-04-01 12:26:23)
Offline
Yeah, I think it is, based on what I learned when making Snapin8r.
Offline
Hardmath123 wrote:
Yeah, I think it is, based on what I learned when making Snapin8r.
Sounds good.
Offline
bharvey wrote:
blob8108 wrote:
Is that flexible enough to store Snap! scripts?
You have to handle atomic types other than text and numbers: lists, Booleans, procedures. If you can handle BYOB3, you can handle Snap!.
Atomic types? Is that an argument to a block?
Offline
blob8108 wrote:
bharvey wrote:
blob8108 wrote:
Is that flexible enough to store Snap! scripts?
You have to handle atomic types other than text and numbers: lists, Booleans, procedures. If you can handle BYOB3, you can handle Snap!.
Atomic types? Is that an argument to a block?
Sorry, it's early in the morning here... I meant "atomic expressions," input expressions that aren't calls to reporters, but just data. But I guess it really boils down to procedures, because we don't have a way to quote a list (as opposed to calling the LIST reporter) nor to quote Booleans. But the point is, when you drag a 2+3 block into a ring that's built into a block because the input was declared as a Procedure type, it means something different from the same block dragged into a Number-type input.
Offline
bharvey wrote:
I meant "atomic expressions," input expressions that aren't calls to reporters, but just data. But I guess it really boils down to procedures, because we don't have a way to quote a list (as opposed to calling the LIST reporter) nor to quote Booleans. But the point is, when you drag a 2+3 block into a ring that's built into a block because the input was declared as a Procedure type, it means something different from the same block dragged into a Number-type input.
But I can just wrap it in a "ring" Block and call it a Block, right? That's the point.
Last edited by blob8108 (2013-04-01 12:24:35)
Offline
blob8108 wrote:
But I can just wrap it in a "ring" Block and call it a Block, right? That's the point.
Yeah. You just have to find out that you should do that by reading the type declarations of the inputs to the outer block.
Offline
bharvey wrote:
blob8108 wrote:
But I can just wrap it in a "ring" Block and call it a Block, right? That's the point.
Yeah. You just have to find out that you should do that by reading the type declarations of the inputs to the outer block.
...ew.
Offline
Ew about the Pico mess, or bharvey's proposition?
BTW 'Actors' and 'Stage' worked perfectly to explain Scratch to the kids I mentioned before. I also told them scripts were like stage directions.
And the Wi-Fi hack failed with Windows.
Offline
blob8108 wrote:
...ew.
Actually, no, I'm wrong. (That's twice this morning. Maybe I should just go back to bed.) Snap! has to do that, but by the time you're reading a saved project, the ringedness or not of a particular actual input expression has already been saved explicitly, just in case the user clicked "unringify."
Offline
this pico censor is a little annoying.
Offline
Hardmath123 wrote:
Ew about the Pico mess, or bharvey's proposition?
What bharvey said.
BTW 'Actors' and 'Stage' worked perfectly to explain Scratch to the kids I mentioned before. I also told them scripts were like stage directions.
Cool, I'll keep `Actor`, then...
And the Wi-Fi hack failed with Windows.
Which wifi hack?
bharvey wrote:
by the time you're reading a saved project, the ringedness or not of a particular actual input expression has already been saved explicitly, just in case the user clicked "unringify."
Oh, sweet. That's good to know!
Offline
This Wi-Fi hack.
I really feel sorry for people who just love Windows 8.
Offline
Hardmath123 wrote:
I really feel sorry for people who just love Windows 8.
We got offered a copy for £20 or something ridiculous — they were basically giving it away...
Why couldn't Windows connect to your server? It has a browser, right...?
EDIT: excessive colon-p
Last edited by blob8108 (2013-04-01 12:28:01)
Offline
joefarebrother wrote:
this pico censor is a little annoying.
Yes. Yes it is.
bharvey wrote:
That's twice this morning.
I forget it's still morning in Berkeley. That's crazy.
Offline
blob8108 wrote:
Hardmath123 wrote:
I really feel sorry for people who just love Windows 8.
We got offered a copy for £20 or something ridiculous — they were basically giving it away...
Why couldn't Windows connect to your server? It has a browser, right...?
Who knows? Like 5 different computers just blankly said they couldn't connect to the server though they recognized it (but didn't ask for my password), but my friend's iPad, my iPad, my Mac, and my mom's Mac all worked perfectly.
EDIT: 'Stephen, I am not a psychologist.'
I doubt anyone but blob will get that.
Last edited by Hardmath123 (2013-04-01 12:34:55)
Offline
blob8108 wrote:
I forget it's still morning in Berkeley. That's crazy.
I just had an idea for a Dashboard widget: a sort of time converter. You have two clocks, and a rough world map under each one. You pick a time zone for each clock, and then drag the hands of one clock to see the corresponding time on the other. There should also be a NOW button to set both clocks to the current time.
Offline
Meh, the wifi thing sounds weird.
Hardmath123 wrote:
'Stephen, I am not a psychologist.'
I doubt anyone but blob will get that.
Actually blob has no idea, either. It's not off some TV programme, is it? I don't watch much TV... (he says, downloading Season 3 of White Collar off iTunes )
Hardmath123 wrote:
I just had an idea for a Dashboard widget
I like the dragging-hands idea. It reminds me of the Minutes dashboard widget, which is the most decent timer I could find. Let me know when you finish your clock!
bharvey wrote:
if you want crazy, it's already tomorrow in Japan!
*dies of shock*
so this April Fools business must be especially confusing.
What, if you're Japanese?
Offline
I think I may have to make Stage an Actor, and this is terrible.
Offline
blob8108 wrote:
What, if you're Japanese?
Yeah. Or Asian generally, I suppose. Then again, WP says April Fools Day is a European tradition, so maybe Asians would be confused even if they were on the MIT side of the dateline.
Offline