Help With Modifying Snap!

I am trying to create a Snap! mod that would add new libraries and possibly change the syntax. Could anyone please help me with that? I am confused with where to put the libraries and where the block names are specified.

Do you mean the kind of library you find in the File menu under Libraries? Or do you mean a JS library included with the source code?

For the former, in the repo, under libraries, you put the xml and then you edit LIBRARIES (a text file) in your favorite simple text editor (i.e. not Word).

For the latter, primitive blocks are listed in the code that generates the palette category it's in. Look in src/objects.js and search for your favorite block name that has either an unusual word ("inherit") or more than one word in a row ("keep items").

Yes.

I cannot find a text file titled Libraries. The nearest one is LIBRARIES without any extension.

Using which does not seem to help me. :frowning_man:

Isn't that what I said?

Make sure that your local version of Snap! is looking for libraries, help, etc. in your copy and not online at snap.berkeley.edu.

You said a text file named Libraries and I thought you were talking about a file named Libraries.txt because txt is the file extension for text files. Please correct me if I am wrong.

I do not think that is the case because it is a fork of Snap!

I said:

I guess you young whippersnappers (by which I mean people younger than about 50) grew up with operating systems that don't generally display the extension as part of the filename, and you're supposed to infer it from how the file behaves when you double-click it. Old folks like me say "LIBRARIES.txt" if that's what we mean. :~)

I am confused with what that means but I think that I got what you mean. Yeah, I use an OS which doesn't display the extension as a part of the filename (Windows) but it does have a part called "File type". But I still do not it is a problem with my OS. GitHub says that the file is named "LIBRARIES". Sorry if it sounds like an argument.

No problem. LIBRARIES is indeed what it's called!

I'm pretty sure that's just a windows thing. I use ubuntu, and the file manager displays a file extension. Why is the file no extension? Usually that means either a directory or an executable binary file. DOS (and the windows terminal emulator) use file extensions, but executables use .exc. How would you know what kind of file it was without running it? (you could open the terminal emulator, but how with GUI)

What is a whippersnappers?

EDIT: In some places, firefox removes the TLDN from a domain name. Are the problems caused by removing the file extension similar?

Okay. Great to hear!

"Snap the whip" is a 19th Century children's game, in which a long line of children hold hands and the ones in front zigzag while running so that the ones at the end get high-acceleration reversals of direction, like a whip being snapped. So "whippersnapper" is an old term for a child. It's no longer used except ironically; the person who says it is positioning himself as really old and out of touch. Kind of like "Get off my lawn!"

There's a Unix command called "file" that will tell you the type of a file:

bhpro13.Home% file libraries/LIBRARIES
libraries/LIBRARIES: ASCII text, with very long lines
bhpro13.Home%
bhpro13.Home% file help/goBack.png
help/goBack.png: PNG image data, 556 x 258, 8-bit/color RGBA, non-interlaced
bhpro13.Home%
bhpro13.Home% file src
src: directory
bhpro13.Home%
bhpro13.Home% file src/threads.js
src/threads.js: UTF-8 Unicode text
bhpro13.Home%
bhpro13.Home% file snap.html
snap.html: HTML document text, ASCII text
bhpro13.Home%

It works by reading the first several bytes of the file and looking for distinctive patterns in various kinds of files.

But, about LIBRARIES, really nobody's supposed to read it except Snap! itself.

painting of

called "Crack the whip"

Yeah that's what Wikipedia says, but the word isn't "whippercrackers" and I claim that it comes from the game, not from the painting. Probably the two names were used interchangeably.

I use windows and it shows the file name in the file manager. I'm pretty sure it's a setting to display the file extensions in the file name.