Discuss Scratch
- Discussion Forums
- » Developing Scratch Extensions
- » First class data
- BookOwl
- Scratcher
1000+ posts
First class data
I have created a first class data ScratchX extension! It supports first class lists and objects.
Extension link
Github repo
Extension link
Github repo
Last edited by BookOwl (June 7, 2016 14:05:33)
who needs signatures
- helloandgoodbye9
- Scratcher
1000+ posts
First class data
Doesnt work for me… I have created a first class data ScratchX extension! It supports first class lists and objects.
Extension link
Last edited by kaj (Tomorrow 25:61:61) ͪͪͪͪͪͪͪͪͪͪ ͣͣͣͣ ͯͯͯͯYes, its above the line)
- Jonathan50
- Scratcher
1000+ posts
First class data
This? When are they going to fix it… In the mean time, load it into scratch.mit.edu.Doesnt work for me… I have created a first class data ScratchX extension! It supports first class lists and objects.
Extension link
Not yet a Knight of the Mu Calculus.
- Jonathan50
- Scratcher
1000+ posts
First class data
It's great!
Can you make a way to clone an object better than
EDIT: And that actually doesn't clone an object.
Can you make a way to clone an object better than
(create object from JSON (object (foo) as JSON :: extension) :: extension)though?
EDIT: And that actually doesn't clone an object.
Last edited by Jonathan50 (June 7, 2016 02:59:01)
Not yet a Knight of the Mu Calculus.
- helloandgoodbye9
- Scratcher
1000+ posts
First class data
No, Im in chrome. Im getting this.This? When are they going to fix it… In the mean time, load it into scratch.mit.edu.Doesnt work for me… I have created a first class data ScratchX extension! It supports first class lists and objects.
Extension link
--#firstclassdata#--#obj#--#id#1
Last edited by kaj (Tomorrow 25:61:61) ͪͪͪͪͪͪͪͪͪͪ ͣͣͣͣ ͯͯͯͯYes, its above the line)
- Jonathan50
- Scratcher
1000+ posts
First class data
I'm certain that's intended.No, Im in chrome. Im getting this.This? When are they going to fix it… In the mean time, load it into scratch.mit.edu.Doesnt work for me… I have created a first class data ScratchX extension! It supports first class lists and objects.
Extension link--#firstclassdata#--#obj#--#id#1
Not yet a Knight of the Mu Calculus.
- helloandgoodbye9
- Scratcher
1000+ posts
First class data
… and can not do anything else.I'm certain that's intended.No, Im in chrome. Im getting this.This? When are they going to fix it… In the mean time, load it into scratch.mit.edu.Doesnt work for me… I have created a first class data ScratchX extension! It supports first class lists and objects.
Extension link--#firstclassdata#--#obj#--#id#1
Last edited by kaj (Tomorrow 25:61:61) ͪͪͪͪͪͪͪͪͪͪ ͣͣͣͣ ͯͯͯͯYes, its above the line)
- helloandgoodbye9
- Scratcher
1000+ posts
First class data
It could just be that Im bad at first class - Im learning object and that this summer. Is there any garbage collection? data still has old objects… Freeing objects should be as simple as decrementing nextobjid.
Oh, and I made pairs:
Last edited by helloandgoodbye9 (June 7, 2016 02:53:14)
Last edited by kaj (Tomorrow 25:61:61) ͪͪͪͪͪͪͪͪͪͪ ͣͣͣͣ ͯͯͯͯYes, its above the line)
- Jonathan50
- Scratcher
1000+ posts
First class data
And can you make an
<object (foo) has property (bar) ? :: extension>block?
Not yet a Knight of the Mu Calculus.
- BookOwl
- Scratcher
1000+ posts
First class data
It's supposed to do that. That's is the objects internal ID. If you want to get a “normal” representation, use the as JSON block.No, Im in chrome. Im getting this.This? When are they going to fix it… In the mean time, load it into scratch.mit.edu.Doesnt work for me… I have created a first class data ScratchX extension! It supports first class lists and objects.
Extension link--#firstclassdata#--#obj#--#id#1
who needs signatures
- BookOwl
- Scratcher
1000+ posts
First class data
Thanks! It's great!
Can you make a way to clone an object better than(create object from JSON (object (foo) as JSON :: extension) :: extension)though?
EDIT: And that actually doesn't clone an object.
What do you mean by “clone an object”?
who needs signatures
- Jonathan50
- Scratcher
1000+ posts
First class data
Oops, of course not, unless you have a compacting GC, which isn't possible… I don't think garbage collection is possible, but explicit freeing of objects would be nice. Freeing objects should be as simple as decrementing nextobjid.
Not yet a Knight of the Mu Calculus.
- Jonathan50
- Scratcher
1000+ posts
First class data
I realized normal JavaScript objects can be returned from Scratch extensions and passed to any block. It even seems to work when you reload the page! But they display as a really ugly string ("[object Object]" in Firefox) and mutation doesn't work for some reason (why???).
Edit: And identity testing doesn't work either, probably for the same reason mutation doesn't work. Is Scratch copying objects somewhere?
Edit: And identity testing doesn't work either, probably for the same reason mutation doesn't work. Is Scratch copying objects somewhere?
Last edited by Jonathan50 (Oct. 5, 2016 05:05:23)
Not yet a Knight of the Mu Calculus.
- Jonathan50
- Scratcher
1000+ posts
First class data
My post didn't bump this thread o_0
Not yet a Knight of the Mu Calculus.
- BookOwl
- Scratcher
1000+ posts
First class data
Interesting. The "[object Object]" part is just what Object.toString() returns. I'll have to experiment with this. I realized normal JavaScript objects can be returned from Scratch extensions and passed to any block. It even seems to work when you reload the page! But they display as a really ugly string ("[object Object]" in Firefox) and mutation doesn't work for some reason (why???).
Edit: And identity testing doesn't work either, probably for the same reason mutation doesn't work. Is Scratch copying objects somewhere?
who needs signatures
- Discussion Forums
- » Developing Scratch Extensions
- » First class data