Hi Kas,

I don't see what the problem is.  You're not sporking 'a public'; surely public is an access modifier that can apply to functions perfectly viably.  I wouldn't expect the code you posted to be illegal, although there may be some slight redundancy.  I haven't chucked for a while, so this could be inaccurate but I think that 'public' there will just mean that you could run (perhaps by sporking, or not, it's somewhat irrelevant) that function from other files once that one had been loaded (and also that you couldn't redefine the function foo() until you restart the VM).  Also, can you not spork a function that returns something, just not access the returned value?  I don't see why not.

Cheers,
Peter

On Sat, Jun 7, 2008 at 11:19 AM, Kassen <signal.automatique@gmail.com> wrote:
Dear list,

Sporking is fun and we can spork fun's (as long as they are of type "void") but now ( http://electro-music.com/forum/viewtopic.php?t=26805 ) it turns out that we can also spork a public. Considering that ChucKian legend has it "spork" is a slightly dirty word "public sporking" must be downright naughty, especially considering no class is needed. I'm sorry; that was too good to pass up.
=========================
//the following will run, not limited in the slightest by trivialities like -say- language specifications.

//note there is no class in sight
public void foo()
        {
        <<<"ping">>>;
        }

spork ~foo();

second => now;
=====================

Could somebody comment on this? Is this of any use at all? well, aside from breaking the monotony of code by having synonyms?

Confused,
Kas.

_______________________________________________
chuck-users mailing list
chuck-users@lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users