F# 2.0 with Powerpack 2.0, fslex error 1 - f#

In namespace RSLispV3.RunTime:
http://pastebin.com/XNb9qi11
LispParser.fsy:
http://pastebin.com/pymF1Vvm
LispLexer.fsl:
http://pastebin.com/pfXdDuxs
I got in MSBuild the PowerPacks targets, calling them from the .fsprog.
When building with VS2008 I get error: "fslex.exe" exited with code 1.
Help?

This might be the same bug I ran into with the Powerpack Metadata library.
You can test it by temporarily creating the registry key
Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.FSharp-1.9.9.9
(an equivalent with 2.0.0.0 should already be there.)
Or just download the updated powerpack binaries; they fixed the problem a couple of days ago.

Solved: my mistake, no ^ operator. Line 11 for future visitors.

Related

Plotly.NET configuration issue

Problem running Plotly.NET on F# Interactive. (VS2019, FSharp Core 7.0.0, Plotly.NET 3.0.1, TargetFramework: net472)
#r C:\....\.nuget\packages\plotly.net\3.0.1\lib\netstandard2.0\Plotly.NET.dll"
open Plotly.NET
let xData = [0. .. 10.]
let yData = [0. .. 10.]
let myFirstChart = Chart.Point(xData,yData)
Gives an error: " C:\...\AppData\Local\Temp\1\unknown(1,1): error FS3216: type 'Plotly.NET.GenericChart+GenericChart' not found in assembly 'Plotly.NET, Version=3.0.0.0, Culture=neutral, PublicKeyToken=.......'. A possible cause may be a version incompatibility. You may need to explicitly reference the correct version of this assembly to allow all referenced components to use the correct version."
What should be correct configuration for environment to get that running?
I'm not sure why you mention "TargetFramework: net472". Also I'm puzzled by your mention of "FSharp Core 7.0.0", since F# interactive is going to be tied to some specific version of F#, for VS 2019 that won't be 7.0.
It's better to use the new syntax for referencing a nuget package from a script:
#r "nuget: Plotly.NET"
I tried your code in VS 2019 (referencing the nuget package as above) and still got a weird error. I then went to Tools | Options | F# Tools | F# interactive and changed the option "Use .NET Core Scripting" from false to true. I then reset the F# interactive session to make the change take effect, and tried your code again, and it worked.
> let myFirstChart = Chart.Point(xData,yData);;
Binding session to 'C:/Users/jimfo/.nuget/packages/plotly.net/3.0.1/lib/netstandard2.0/Plotly.NET.dll'...
Binding session to 'C:/Users/jimfo/.nuget/packages/dynamicobj/2.0.0/lib/netstandard2.0/DynamicObj.dll'...
val myFirstChart: GenericChart.GenericChart =
Chart
(Plotly.NET.Trace2D, Plotly.NET.Layout, Plotly.NET.Config,
Plotly.NET.DisplayOptions)
I didn't bother testing 32 bit vs 64 bit or seeing what happens in VS 2022.
I don't know what the errors are about, I have seen some strange errors lately given the mix of F# compiler versions, FSharp.Core versions, VS versions (think of all the patched versions), and sometimes you have to just fool around a bit until you get the right combination that works.

Gsteamer conflicting declaration in opencv in Yocto build

I am building Yocto 2.5(Sumo) with Gstreamer 1.14 and OpenCV 3.4.5
I am getting this error while compiling Gstreamer:
build_xwayland_mq/tmp/work/aarch64-mx8m-poky-linux/gstreamer1.0-plugins-bad/1.14.4.imx-r0/recipe-sysroot/usr/include/opencv2/imgproc/types_c.h:445:21: error: conflicting declaration of C function 'CvMoments cvMoments(const cv::Moments&)'
CV_INLINE CvMoments cvMoments(const cv::Moments& m)
same error in imgproc_c.h:360:13
I saw someone solved this by building with OpenCV 4 instead, but we need OpenCV 3.4.5 for our own project.
Anyone know how to resolve this conflict?
too long for comment..
I did just quick search, found this:
https://www.yoctoproject.org/pipermail/meta-freescale/2019-March/023888.html
There is some problem in includes .. I guess in mentioned hpp files there are some types that are not declared in that imgproc_c.h for 3.4, but already are moved there for opencv 4 (just my guess).
You just need to add those hpp on all places (in gst plugins bad) where you find include for imgproc_c.h.
Take inspiration from this.. or maybe it itself will solve your issue:
https://git.yoctoproject.org/cgit/cgit.cgi/meta-freescale/tree/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-opencv-fix-build-for-opencv-3-4-2.patch?h=thud
The patch is for yocto thud.. but perhaps it does not matter for GStreamer.
In worst case you will have to backport it or make your own patch for sumo.
Or if you can try update to thud (should be small difference) or newer and check if it persists.

F# tryHead is not defined

I am using Seq.tryHead but I am getting an error
let maybeTagDatabaseModel = Seq.tryHead tagSeq
error
error FS39: The value, constructor, namespace or type 'tryHead' is not defined
Does anyone have suggestions on how to fix? Thanks
For future visitors
The problem seemed to be this dependency "FSharp.Interop.Dynamic": "3.0.0" in the project.json file.
Two of my projects were on version less than 4. Upgraded those and they work now.

TIdHash128 Missing From Delphi XE3?

I am having a problem with Delphi XE3's Indy10. I cannot locate the class TIdHash128.
Indy's documentation states this should be found in IdHash.pas but this is not the case on my PC. Oddly enough the comment at the top of IdHash.pas reads "Rev 1.10 7/24/04 12:54:32 PM RLebeau Compiler fix for TIdHash128.HashValue()" despite having no definition for TIdHash128 in the file. I have also done a search through the source files but no TIdHash128 was found.
Is this supposed to be missing from XE3's version of Indy10?

FsLex changed with latest PowerPack?

I've been working on a compiler for a while but after changing to PowerPack 1.9.9.9 and the release version of VS2010 I'm no unable to compile the following line:
let lexbuf = Lexing.from_string text
I get the following two error:
"The value, constructor, namespace or type 'from_string' is not defined" pretty obviopus what it's trying to tell me but what's the resolution?
My quick guess is that this function has been renamed to fromString (because, in general, functions with underscores such as of_seq are now written in camelCase).
Lexing.LexBuffer<_>.FromString ?

Resources