[chuck-users] Public sporking?

Peter Todd chuck at xinaesthetic.net
Sat Jun 7 06:47:33 EDT 2008

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.


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

> 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 at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20080607/002b0f03/attachment.html>

More information about the chuck-users mailing list