We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
Bookshelf (Read 994 times)
Bookshelf
Oct 16th, 2006, 8:59pm
 
I have a few sketches where I re-use a few functions, so I've been putting those functions into their own files, and then just copying the files into the other sketch's folder, or copy and paste it in.

What do you think of built-in functionality (i was thinking the name "the bookshelf"  or "the shelf") where you can take files (pages?) from your sketch and put them on your own personal function library, accessible like the libraries.

You could take any file in any sketch, and push it onto the bookshelf, and then pull down any file from the bookshelf and shove it into a new sketch and so on.

Sorta helps promote code-reuse without making libraries, for small things.

Thoughts?  

(I was thinking about adding this in to the processing source to try it out myself, but it'll be a little while before I had a chance to do it... i didn't know if something like this was considered at some point, or if it was decided against, etc..)
Re: Bookshelf
Reply #1 - Oct 16th, 2006, 11:52pm
 
I like this idea. I also have a few pde files that tend to get copied form one place to another.

I think the intention is for things liek that, you should probably turn them into a library of your own, which is actually fairly simple, it just needs a little bit of faffing to get things set up the first time, then after that you just have to add a line or two to your .pde file, and you can turn it into a library.

Maybe a "compile this PDE to a library" button woudl be possible? Just add a "package my.identifier.UsefulCode;" line, and hit the button.
Re: Bookshelf
Reply #2 - Oct 17th, 2006, 10:48am
 
not to forget the online snippet place by seltar.
Re: Bookshelf
Reply #3 - Oct 17th, 2006, 7:01pm
 
We've discussed an idea similar to this since the origins of Processing. It has many benefits. In our scenario, images and other media files could also be stored in a common location that can be accessed by all sketches without import statements.

We decided not to implement it yet because, for one reason, it hurts the portability of code. It makes it more difficult to copy code from one place to another and to share code with other people because they don't have the same shared library on their machine.

I think the ideas posted so far to this thread are great, we should re-think this after 1.0 is out.
Re: Bookshelf
Reply #4 - Oct 18th, 2006, 11:23pm
 
i was actually thinking that you had to pull the files from the bookshelf into your sketch to use them.


I hadn't seen seltar's snippet place before.  snazzy!
Page Index Toggle Pages: 1