Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion Anonymous callables
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Justin Chase  
View profile  
 More options Jun 23 2009, 8:20 pm
From: Justin Chase <justin.m.ch...@gmail.com>
Date: Tue, 23 Jun 2009 19:20:50 -0500
Local: Tues, Jun 23 2009 8:20 pm
Subject: Re: Anonymous callables

Feels a little wrong but you can do this:
Foo({i |
j = i * 2;
print j;

}, 1)

I think the semi colons work because the newline is ignored when inside of
another expression (the method invoke expression).

On Tue, Jun 23, 2009 at 5:13 PM, Ayende Rahien <aye...@ayende.com> wrote:
> I am trying to make something like this works:
> import System

> callable IntCallable(i as int)

> def Foo(f as IntCallable, i as int):
>  f(i)

> Foo({i |
> j = i * 2
> print j
>  }, 1)

> Actually, I would probably like the do(i) syntax better, but either of them
> give me compilation errors.
> Short of defining this as a variable, is there a syntax option that I am
> missing?

--
Justin Chase
http://www.justnbusiness.com

    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google