« Return to Thread: [scala] F# code

Re: [scala] F# code

by Michael Songy :: Rate this Message:

Reply to Author | View in Thread

You could use JNI to call into a native library, and use .NET interop in that native library to call back into your F# code.  It makes me queasy just thinking about it, but you should be able to do it.

-Mike

Onorio Catenacci wrote:


On Tue, Jul 7, 2009 at 4:11 AM, Ricky Clarkson <ricky.clarkson@...> wrote:
You cannot.  Scala only implements the Scala programming language, not F#.

2009/7/7 SALEH AL-SHADLY <alshadly09@...>:
> Dear all,
>
> how can I use codes of other languages (such F#) in Scala?
>
> Saleh
>



--
Ricky Clarkson
Java Programmer, AD Holdings
+44 1565 770804
Skype: ricky_clarkson
Google Talk: ricky.clarkson@...

You can't directly but it would be possible (as far as I know) to create a F# COM object and then use something like Jacob to call the COM object from Scala code.  But it'd be kind of a hack so I'd really think long and hard about the necessity to code part of the solution in F#.  If part of your solution is already coded in F#, then that might be a way for you to reuse the code but, as I said, I'd really have to give such a solution a lot of thought before I went that way.  And, of course, using COM ties you to Windows if that's a consideration.


--
Onorio

It is the greatest of all mistakes to do nothing because you can only do a little. -Sydney Smith, writer and clergyman (1771-1845)


 « Return to Thread: [scala] F# code