I have a suggestion for a future version of BYOB. It would be useful to have these two blocks:
1. '(blocks) as list' , which takes a stack of blocks as its only input, ex. move 10 steps, turn 90 degrees, move 10 steps, and reports a list with one block per list item, ex. list(move 10 steps; turn 90 degrees; move 10 steps)
2. In a similar vein, 'join blocks (block1)(block2)' would take two command-type inputs, blocks or stacks of them, and report a stack of the two. Example: input1 is move 10 steps, input2 is turn 90 degrees. Result is the stack move 10 steps, turn 90 degrees.
The 'blocks as list' would be useful if you were writing a command structure like 'do (stack), waiting for (boolean) between each' and you didn't want the user to have to create a new command slot (multiple-input style) for each block in the stack.
If any of the above are impossible, unnecessary, or insane, feel free to ignore them! Thank you.
Offline
Those are certainly interesting ideas...
I think it'd work!
Offline
EvilGenius wrote:
1. '(blocks) as list'
2.'join blocks (block1)(block2)'
Yes. We're definitely interested in some form of program introspection. One important piece of that is the ability to get at the script behind a custom block, so that should be in your proposal too.
I'm agitating for translating scripts to Scheme and then making the Scheme code (as a list, which is what Scheme code is, not as a text string) available for inspection and processing.
Offline
Scripts (stacks of command blocks) could just be represented as lists of individual command blocks. I guess that part would be pretty straight forward. But how about reporters and literal values? You know, maybe I'm gradually coming around to your translating-to-Scheme vision...
Offline
Jens wrote:
Scripts (stacks of command blocks) could just be represented as lists of individual command blocks. I guess that part would be pretty straight forward. But how about reporters and literal values? You know, maybe I'm gradually coming around to your translating-to-Scheme vision...
What if you had a block that took some nested reporters and evaluated only the innermost? You could call it 'evaluate first of':
Evaluate first of '3+'4*5'' - '3+20'
The reverse could be 'first operation of':
first operation of '3+'4*5'' - '4*5'
On a somewhat unrelated note, 'inputs to ' would also be useful:
inputs to 'move 10 steps' - 10
inputs to 'join 'Hello, '(answer) - list 'hello', (answer)
inputs to '3*5' list 3, 5
You'd need one for reporters and one for commands. Again, I don't know anything about Squeak (or Scheme, for that matter)- these are just my ideas.
EDIT: The 'first operation of' should report a list of the first operations, as in ((2+2)*(5+4))
reports list((2+2), (5+4))
Last edited by EvilGenius (2010-10-13 15:02:21)
Offline
Jens wrote:
Scripts (stacks of command blocks) could just be represented as lists of individual command blocks. I guess that part would be pretty straight forward. But how about reporters and literal values? You know, maybe I'm gradually coming around to your translating-to-Scheme vision...
Well, I think if you were to represent stacks and nested reporters as nested lists (like my compiler), closures (sorry, I should stop calling them that and confusing people; are byob's actually closures, or are they just anonymous functions? I thought they were closures because of the OOP examples, is that right?) should be split up and represented as nested lists as well, so that once you've accessed the body code of a custom block or closure (...) you could modify it with list primitives and run your modified version.
HOWEVER, this would also mean that the run primitive would take a LIST as input and run the list's code. For example, I have a function which repeats the script "MOVE 100 STEPS/TURN CW 60 DEGREES" 4 times. The list of code looks like this:
- {
{
REPEAT[ ]
4
{
{
MOVE () STEPS
100
}
{
TURN CW () DEGREES
60
}
}
}
}
(come to think of it, a block -> argument dictionary list would be even better, but...)
I want to modify it to repeat six times. I would do the following:
set {original} to (the script{move 100 steps; turn cw 60 degrees})
replace item (2) of (item (1) of (item (1) of (original))) with (6)
After typing that all, it no longer seems like a good idea, the list format is too loose and hard to understand. :/
Last edited by nXIII (2010-10-12 18:41:44)
Offline
EvilGenius wrote:
I have a suggestion for a future version of BYOB. It would be useful to have these two blocks:
1. '(blocks) as list' , which takes a stack of blocks as its only input, ex. move 10 steps, turn 90 degrees, move 10 steps, and reports a list with one block per list item, ex. list(move 10 steps; turn 90 degrees; move 10 steps)
2. In a similar vein, 'join blocks (block1)(block2)' would take two command-type inputs, blocks or stacks of them, and report a stack of the two. Example: input1 is move 10 steps, input2 is turn 90 degrees. Result is the stack move 10 steps, turn 90 degrees.
The 'blocks as list' would be useful if you were writing a command structure like 'do (stack), waiting for (boolean) between each' and you didn't want the user to have to create a new command slot (multiple-input style) for each block in the stack.
If any of the above are impossible, unnecessary, or insane, feel free to ignore them! Thank you.
That, and
(number of arguments in [a block])
(argument (num) of [a block])
(replace argument (num) of [a block] with [another input])
I DESPERATELY NEED ALL THESE BLOCKS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Offline
@Jens&bharvey
I see the point, and probably that the structure of Scratch+Byob is not adequated to what is asked. But in the mean time we can benefit of the great flexibility of Byob to do such things like :
ADD CSHAPE [TURN 90] TO SQUARELIST
ADD CSHAPE [MOVE #1] TO SQUARELIST
ADD CSHAPE [TURN 90] TO SQUARELIST
ADD CSHAPE [MOVE #1] TO SQUARELIST
ADD CSHAPE [TURN 90] TO SQUARELIST
ADD CSHAPE [MOVE #1] TO SQUARELIST
ADD CSHAPE [TURN 90] TO SQUARELIST
ADD CSHAPE [MOVE #1] TO SQUARELIST
Then :
FOREACH ITEM OF SQUARELIST
RUN ITEM # OF SQUARELIST WITH INPUTS 90
And you have drawn a square of side 90
As the LIST structure has already all what you need to ADD,REPLACE,INSERT,DELETE,etc
you can already mimic a kind of self-modifying program.
Then ...we can imagine a new primitive ADDCSHAPE [ Instruction ] to feeds the CSHAPE like : ADDCHAPE [ TURN 90] TO SQUARELIST etc
or : ADDCSHAPE [LIST [[TURN 90][MOVE #1]...etc]] TO SQUARELIST
Up to you !!
Offline
bharvey wrote:
shadow_7283 wrote:
Windows 7. How you live with XP I do not know.
I'll let Jens look into this, then; he has a Windows 7 box.
I asked our sysadmins about switching to Windows 7 and they strongly advised me against it on the grounds that it's a big resource hog and would probably make my PC sluggish. (It's a few years old.) But the real answer is that I don't live with XP. I don't see how you live with Windows period! The machine I use for real work and for handling email and stuff runs Linux, and the machine I keep at home runs MacOS. I have this little PC laptop that boots Linux when I take it to a conference but when it's sitting next to my real computer I let it run Windows just so I can check out whether BYOB and Berkeley Logo work. But far be it from me to start a flame war. Shadow started it! Blame him!
Really, I dont really care about this whole PC vs Mac thing..... :I They are both good but, A Macbook Pro for $1700 is the equivalent of a Lenovo for $700.... BUT WAIT THERE'S MORE!!! The Lenovo has a fingerprint reader! BEAT IT APPLE!!! TRY TO!
P.S. The little white thing under under the keyboard is the fingerprint reader.
The picture is a link, too.
Last edited by Fiat500 (2010-10-13 18:27:23)
Offline
shadow_7283 wrote:
Alright, here is the argument against Macs.
Some background info:
We want to use Hamachi for a Prism project, but Hamachi is only for Windows. fg123 tells The-Whiz to use a program called Wine to run it. The-Whiz begins...The-Whiz wrote:
No thanks, I don't want to increase my chance of getting a Virus by downloading WIndows applications.
Shadow_7283 wrote:
Don't go dissing PCs. fg123 gave you an option, and you didn't want to take it. So that doesn't mean we can't develop it.
The-Whiz wrote:
I'll diss PCs all I want.
Shadow_7283 wrote:
Doesn't change the fact that Macs are rip-off overpriced computers that don't deserve to be looked at, much less bought.
The-Whiz wrote:
At least Apple has SOME sense of design, unlike all the Windows computers I've seen that are made with pointy angles and look like they were carved out of rock. Seriously, Windows is slow, prone to crashing, gets viruses easily, etc.
Shadow_7283 wrote:
The OS doesn't have much to do with speed. Most of the speed you get from a computer has to do with the RAM and the processor. The equivalent of a 1700$ MacBook pro (Intel Core i5 processor, 2.4 ghz; 4gb DDR3 ram; 320 gb hard drive) is a 700$ Lenovo laptop. http://www.tigerdirect.com/applications … CatId=4938.
I don't care about style, just a good, reasonably priced computer.JBENZ wrote:
(From: http://askville.amazon.com/Macs-immune- … Id=9106500)
The only reason Macs have fewer security problems is because there aren't enough of them out there to make it work the hacker's time to bother writing the code.http://gadgetopia.com/post/6179
Macs crash too, sometimes worse than PCs.
And frankly, the software and OS for Macs can easily be replaced on the PC. So you aren't even getting that.
Summary:
MACS STINK.Please note that I am NOT posting this to provoke a fight, just to give an example of an argument that was had and the information and opinions we shared. So don't take it personally.
That link: http://gadgetopia.com/post/6179 just supports it: MACS STINK BADLY. THEY NEED DEODORANT.
Offline
ScratchReallyROCKS wrote:
shadow_7283 wrote:
Alright, here is the argument against Macs.
Some background info:
We want to use Hamachi for a Prism project, but Hamachi is only for Windows. fg123 tells The-Whiz to use a program called Wine to run it. The-Whiz begins...The-Whiz wrote:
No thanks, I don't want to increase my chance of getting a Virus by downloading WIndows applications.
Shadow_7283 wrote:
Don't go dissing PCs. fg123 gave you an option, and you didn't want to take it. So that doesn't mean we can't develop it.
The-Whiz wrote:
I'll diss PCs all I want.
Shadow_7283 wrote:
Doesn't change the fact that Macs are rip-off overpriced computers that don't deserve to be looked at, much less bought.
The-Whiz wrote:
At least Apple has SOME sense of design, unlike all the Windows computers I've seen that are made with pointy angles and look like they were carved out of rock. Seriously, Windows is slow, prone to crashing, gets viruses easily, etc.
Shadow_7283 wrote:
The OS doesn't have much to do with speed. Most of the speed you get from a computer has to do with the RAM and the processor. The equivalent of a 1700$ MacBook pro (Intel Core i5 processor, 2.4 ghz; 4gb DDR3 ram; 320 gb hard drive) is a 700$ Lenovo laptop. http://www.tigerdirect.com/applications … CatId=4938.
I don't care about style, just a good, reasonably priced computer.
http://gadgetopia.com/post/6179
Macs crash too, sometimes worse than PCs.
And frankly, the software and OS for Macs can easily be replaced on the PC. So you aren't even getting that.
Summary:
MACS STINK.Please note that I am NOT posting this to provoke a fight, just to give an example of an argument that was had and the information and opinions we shared. So don't take it personally.
Okay. Please tell me HONESTLY what is wrong with Macs. What important thing can you not do on them that you can do on a PC?
Well.. THEY STINK.
Offline
shadow_7283 wrote:
Just like it annoys me when people say Windows and PCs are horrible.
It also bugs me when Steve Jobs releases Apple's next device that is almost the exact same as the old one with a bigger screen. Apple's "no code interpretation policy" also annoys me.
But enough of that.
Actually, Apples pretty good... OTHER THAN MACS......
Offline
shamrocker wrote:
shadow_7283 wrote:
Just like it annoys me when people say Windows and PCs are horrible.
It also bugs me when Steve Jobs releases Apple's next device that is almost the exact same as the old one with a bigger screen. Apple's "no code interpretation policy" also annoys me.
But enough of that.
First thing - PC mean Personal Computer, and macs were the first PCs. Second thing - The iPad is awesome.
iPads, ARE NOT MACS. sorry i sounded like a snob there.
Last edited by Fiat500 (2010-10-12 20:31:03)
Offline
Fiat500 wrote:
shadow_7283 wrote:
bharvey wrote:
Yes, it runs XP. Which flavor of Windows are you? Tnx.
Windows 7. How you live with XP I do not know.
I. HATE. XP.
HOW THE #Ë!! CAN YOU SAY THAT!
Seriously, I'm using a Windows XP right now. And there isn't a single other computer I've seen that's faster. It takes 1 SECOND to log on and rarely lags.
And I've *never* gotten a virus (I run Norton scans & updates every time I use the computer)
Last edited by rubiks_cube_guy238 (2010-10-12 20:41:19)
Offline
rubiks_cube_guy238 wrote:
Fiat500 wrote:
shadow_7283 wrote:
Windows 7. How you live with XP I do not know.
I. HATE. XP.
HOW THE #Ë!! CAN YOU SAY THAT!
Seriously, I'm using a Windows XP right now. And there isn't a single other computer I've seen that's faster. It takes 1 SECOND to log on and rarely lags.
And I've *never* gotten a virus (I run Norton scans & updates every time I use the computer)
Wow. I can't believe someone had the time and patience to dig through that OS discussion. That was PAGES ago.
So before someone scolds us for being off-topic, I'll have my say in it.
Windows XP. Not as fast. Not 64 bit. You shouldn't be saying that the computer is faster anyway because you are talking about the Windows XP OS, and like Fiat500 said, it's usually the guts of the PC that matter when it comes to speed.
True, you are going to see less viruses on XP more and more as the creators of the viruses don't have the number of targets that they used to. Plus, Microsoft has worked out almost all of the security issues in the XP operating system (for the OS, not referring to viruses from other security holes). But, the fact that you have never gotten a viruses could also have to do with Norton (which personally I can't stand).
Last edited by shadow_7283 (2010-10-12 21:20:42)
Offline
rubiks_cube_guy238 wrote:
Fiat500 wrote:
shadow_7283 wrote:
Windows 7. How you live with XP I do not know.
I. HATE. XP.
HOW THE #Ë!! CAN YOU SAY THAT!
Seriously, I'm using a Windows XP right now. And there isn't a single other computer I've seen that's faster. It takes 1 SECOND to log on and rarely lags.
And I've *never* gotten a virus (I run Norton scans & updates every time I use the computer)
It's better than Vista, but not 7. And Mac OS X Snow Leopard beats them all.
Anyway, back on topic. Hmmm, really all I have to say is that BYOB 3 is awesome. Can't think of much more.
EDIT:
Fiat500 wrote:
iPads, ARE NOT MACS. sorry i sounded like a snob there.
yes they are, they're based off the Mac OS, and are very much like it. They still run the same unix kernel and all.
Last edited by ScratchReallyROCKS (2010-10-12 21:28:21)
Offline
xly wrote:
we can imagine a new primitive ADDCSHAPE [ Instruction ] to feeds the CSHAPE like : ADDCHAPE [ TURN 90] TO SQUARELIST etc
or : ADDCSHAPE [LIST [[TURN 90][MOVE #1]...etc]] TO SQUARELIST
No need for a new primitive; the ability to define C-shaped blocks in BYOB lets you write this easily.
Offline
shadow_7283 wrote:
Windows XP. Not as fast. Not 64 bit. You shouldn't be saying that the computer is faster anyway because you are talking about the Windows XP OS, and like Fiat500 said, it's usually the guts of the PC that matter when it comes to speed.
Wait, didn't I already argue you out of this last time around? Take a computer built for XP and run Vista or 7 on it and watch what happens.
Offline
@Jens and nXIII: The only thing is, Scheme is weakly (dynamically) typed, so a Scheme procedure isn't exactly equivalent to a BYOB one unless it starts with a bunch of type checking of inputs. But there are statically typed variants of Scheme we could use. Or we could ignore it; it doesn't really matter unless you try to translate the Scheme back into BYOB.
@Shadow: Speaking of arguing, I've been wondering, did you get bored with that other argument?
Offline
bharvey wrote:
@Jens and nXIII: The only thing is, Scheme is weakly (dynamically) typed, so a Scheme procedure .....Or we could ignore it; it doesn't really matter unless you try to translate the Scheme back into BYOB.
Joining discussions about PC (personal computer) power comparisons and ADDCSHAPE new feature, I inform you that I have completed my homework, consisting to convert into Byob a bunch of Logo programs written 30 year ago with the Apple ][ Logo running on a Apple ][ 64 K of memory (N° 616365) and a floppy unit of 156 K (N° 521905) !!!
...except some applications where is used the couple of primitives DEFINE/TXT which allows to define inside a function a new function defined by list of instructions (continuously modified elsewhere outside the 1st function ). This is typical of Lisp&Logo. We have discussed this issue some months ago, and you explained that Scratch-Byob structure is not adapted to such "text" handling as it is not based on text instructions. But 1st- there are many ways to workaround this and 2nd- "don't allways ask what Byob can do for you, but what you can already do with Byob". (and there is a lot to do !!!).
To change the viewpoint of the question as it is raised, I wonder if the "property" mechanism is not adapted to such cases where you need to continuously add new properties ( like for example to add powers to one character" of a wargame) I've not yet started to explore this with Byob.
Offline