hubFS: THE place for F#

. . . are you on The Hub?
Welcome to hubFS: THE place for F# Sign in | Join | Help
in Search

Problem using quotations in fsi

Last post 03-31-2008, 22:52 by cstaszak. 5 replies.
Sort Posts: Previous Next
  •  03-26-2008, 20:55 5549

    Problem using quotations in fsi

    I've been tinkering with F# on OS X/Mono and cannot get quotations to work for the life of me. Attempting a simple example yields the following:

    MSR F# Interactive, (c) Microsoft Corporation, All Rights Reserved
    F# Version 1.9.3.14, compiling for .NET Framework Version v2.0.50727

    > #light;;
    > open Microsoft.FSharp.Quotations;;
    > open Microsoft.FSharp.Quotations.Raw;;
    > open Microsoft.FSharp.Quotations.Typed;;
    > <@ 1 + 2 @>;;
    System.ArgumentException: Field not large enough to fill array
    Parameter name: field_handle
      at (wrapper managed-to-native) System.Runtime.CompilerServices.RuntimeHelpers:InitializeArray (System.Array,intptr)
      at System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray (System.Array array, RuntimeFieldHandle fldHandle) [0x00000]
      at <StartupCode$FSI_0005>.FSI_0005._main () [0x00000]
      at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[])
      at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000]
    stopped due to error


    My Mono information:

    Mono JIT compiler version 1.2.6 (tarball)
    Copyright (C) 2002-2007 Novell, Inc and Contributors. www.mono-project.com
        TLS:           normal
        GC:            Included Boehm (with typed GC)
        SIGSEGV:       normal
        Notification:  Thread + polling
        Architecture:  x86
        Disabled:      none

    I have the same exact problem if I try to evaluate <@@ 1 + 2 @@> using fsi as well.

    Is this a problem with me, Mono, OS X, fsi, or ? I can successfully compile and run the following:

    #light

    open System
    open Microsoft.FSharp.Quotations
    open Microsoft.FSharp.Quotations.Raw
    open Microsoft.FSharp.Quotations.Typed

    let main() =
       let foo = <@@ 1 + 2 @@>
       printfn "%A" foo

    main()


    Any assistance or insight would be appreciated.

    Thanks,
    Chris

    --
    Chris
    http://www.staze.net
  •  03-27-2008, 1:30 5556 in reply to 5549

    Re: Problem using quotations in fsi

    I'm guessing it's a mono problem, I've tested the code in the 1.9.3.7 console that I have installed on my winnxp machine here at work and everything seems okay.

    Cheers,
    Rob


    Robert Pickering, MVP
    http://strangelights.com
  •  03-27-2008, 21:52 5573 in reply to 5556

    Re: Problem using quotations in fsi

    I was afraid of that.

    It looks like I'll have to abandon Mono (for now) for any serious F# exploration. Time to buy a copy of Windows and fire it up under Parallels.

    Thanks for the speedy reply.


    --
    Chris
    http://www.staze.net
  •  03-28-2008, 10:05 5578 in reply to 5573

    Re: Problem using quotations in fsi

    Are you running F# (fsi) under .NET 1.0 or 2.0?

    Check the following thread:

    http://cs.hubfs.net/forums/permalink/4703/4698/ShowThread.aspx#4698

    James


    "It seems that perfection is reached, not when there is nothing left to add, but rather when nothing more can be taken away." -- Antoine de St. Exupéry
  •  03-28-2008, 20:50 5588 in reply to 5578

    Re: Problem using quotations in fsi

    .NET 2.0

    Thanks for the reference - I've been down that path already - before I had everything pointing to .NET 2.0 many other items were broken for me (more on my saga here).
    --
    Chris
    http://www.staze.net
  •  03-31-2008, 22:52 5618 in reply to 5588

    Re: Problem using quotations in fsi

    Quick update: I put a freshly installed F# 1.9.3.14 (setup for .NET 2.0) and updated Mono 1.9 into place - just to try that route one more time - and have the same error with fsi (and as before fsc works just fine).

    Mono details:

    Mono JIT compiler version 1.9 (tarball)
    Copyright (C) 2002-2007 Novell, Inc and Contributors. www.mono-project.com
        TLS:           normal
        GC:            Included Boehm (with typed GC)
        SIGSEGV:       normal
        Notification:  Thread + polling
        Architecture:  x86
        Disabled:      none

    If I come across any more findings I will post them here.



    --
    Chris
    http://www.staze.net
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems