Questions about snap!

It is still very impressive I also made an forums

I got inspiration from Snap! And Scratch

And I got inspiration from Snap! Source like each block has an type and target those variables are in my code and they do the exact same things to the blocks

If you wanna see the code for Blockal then goto Blockal - Replit

Only 2 files

I updated it

You are right I haven’t

I’ve did it

If I was John Maloney then Snap woukd turn out way way way different then it is today and by different I mean we would have an extra category actually 10 more

Do you mean OOP object oriented programming

I am technically making snap if I had designed it

Also when I grow older I wish to either go to MIT or Berkeley or even if I get lucky Harvard

I’m gonna get my masters on Engineering and computer science

I also was wondering where you folks got your inspiration from or your ideas

Users can make all the categories they want. But it's hard to find 20 colors (plus their tints for zebra coloring) that are all readily distinguishable. It's bad enough that Looks and Sounds are both purplish. Also, 20 categories (existing 10 + your ten) would make Snap! intimidating to beginners, which kind of defeats the object of the exercise. (Never mind beginners; even I find the SciSnap! palette intimidating.)

No. (But the manual shows how to use first class procedures to implement OOP.)

A data type is "first class" if an instance of that type can be

  • the value of a variable
  • an input to a procedure
  • the value returned (reported) by a procedure
  • a member of a data aggregate (e.g., a list)
  • created without giving it a name

So, numbers, for example, are first class in any real programming language.

Now think about lists. They're first class in Snap! but not in Scratch. This was a deliberate design decision on their part, in an effort to make lists less intimidating. But what do I mean by first class lists?

Can a list be the value of a variable? We can say
untitled script pic (2)
but they don't have a LIST reporter, so they can't.

Can a list be an input to a procedure? In Snap! they can:
untitled script pic (3)

Can a list be reported by a procedure? We can do that:

Can a list be a member of a list? In Snap! it can:

Can a list exist without having a name? In Snap! it can; the lists that are reported in the two previous points don't have names. But in Scratch when you make a list the first thing it does is make you type in a name for it.

So, the first thing you have to do is understand why Scratch decided not to make lists first class. Hint: Their metaphor for lists is that a list is a kind of variable, not a kind of datum.

Okay, after all that we can talk about first class procedures. An anonymous procedure is one that doesn't have a name. You can't make one of those with the "Make a block" button; you can't delete the hat block in the Block Editor.

But you can make an anonymous procedure by wrapping a ring around a script:

As you see, the value reported by a ring is a script.

There are several ways to ringify a script. You can drag an empty ring from the top of Operators. You can choose "ringify" from the script's context menu. Or, most importantly, you can drag the script into a procedure-valued input of a block. Blocks that take scripts as input are called higher order procedures. The input slot that wants a procedure as input has a handy ring already in the input slot, so you can just drag a script into the slot and it's automatically ringified.

Less common, but super useful, are blocks that report procedures. This feature is used, for example, in the OOP system in the manual.

Didn't we just talk about this? I mentioned Scratch and Smalltalk. I didn't mention, but should have, Lisp (John McCarthy) and Scheme (Gerald J. Sussman and Guy Steele), which is a dialect of Lisp. Hyperblocks from APL (Ken Iverson). Words and sentences from Logo (Seymour Papert).

And every few years we actually had an idea of our own. :~P

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.