Click here to Skip to main content
15,912,837 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: System.Enum - not a class? Pin
Adrian Cole4-Apr-09 6:29
Adrian Cole4-Apr-09 6:29 
GeneralRe: System.Enum - not a class? Pin
Eddy Vluggen4-Apr-09 23:01
professionalEddy Vluggen4-Apr-09 23:01 
GeneralRe: System.Enum - not a class? Pin
dojohansen14-Apr-09 7:13
dojohansen14-Apr-09 7:13 
AnswerRe: System.Enum - not a class? Pin
PIEBALDconsult5-Apr-09 6:22
mvePIEBALDconsult5-Apr-09 6:22 
QuestionRe: System.Enum - not a class? Pin
Adrian Cole5-Apr-09 18:50
Adrian Cole5-Apr-09 18:50 
AnswerRe: System.Enum - not a class? Pin
PIEBALDconsult6-Apr-09 4:27
mvePIEBALDconsult6-Apr-09 4:27 
GeneralRe: System.Enum - not a class? Pin
Adrian Cole6-Apr-09 8:52
Adrian Cole6-Apr-09 8:52 
QuestionProblems when reimplementing c# class to f# Pin
Ravadre3-Apr-09 11:54
Ravadre3-Apr-09 11:54 
Hello,
Recently I've decided to rewrite some of my C# code to F# (pratice, learn, maybe move and optimize some code for future). Unfortunately I've faced few problems.
Let's say I have a c# class that looks like this:
public class MersenneTwister : Random
{
    private const int N = 624;
    private uint[] mt = null;

    public MersenneTwister(uint seed)
    {
        mt = new uint[N]
        mt[0] = seed & 0xffffffffU;
        for (int mti = 1; mti < N; ++mti)
        {
             mt[mti] = (69069 * mt[mti - 1]) & 0xffffffffU;
        }
    }
}


I have no idea how to create constants like N - I could write static let N = 24 but:
- After compilation, c#'s version does replace N with number, as consts should work, f# does not (it uses static field to represent N)
- I can't use static let if I don't have implicit constructor for type, and I can't have one, because my constructor has to implement some code.
I have to create mt array as mutable, but I can't use let (no implicit constructor), if I use member x.mt : uint32 array = Array.create N 0u instead, new array will be created each time I use mt property.

I will be grateful for any ideas.
I also must add that, I can't believe so many people say f# is much more expressive and easier then c#, I'm trying to learn it, but for now, each time I want to do something my way, I have to search informations in books and/or google a lot Frown | :(
AnswerRe: Problems when reimplementing c# class to f# Pin
Kevin McFarlane3-Apr-09 12:42
Kevin McFarlane3-Apr-09 12:42 
QuestionGeneral question about allocate memory in .NET Pin
Yanshof3-Apr-09 7:05
Yanshof3-Apr-09 7:05 
AnswerRe: General question about allocate memory in .NET Pin
Luc Pattyn3-Apr-09 7:24
sitebuilderLuc Pattyn3-Apr-09 7:24 
GeneralRe: General question about allocate memory in .NET Pin
led mike3-Apr-09 8:31
led mike3-Apr-09 8:31 
GeneralRe: General question about allocate memory in .NET Pin
Luc Pattyn3-Apr-09 8:45
sitebuilderLuc Pattyn3-Apr-09 8:45 
GeneralRe: General question about allocate memory in .NET Pin
harold aptroot3-Apr-09 13:10
harold aptroot3-Apr-09 13:10 
Generalcount save Pin
AARONDAS3-Apr-09 6:42
AARONDAS3-Apr-09 6:42 
GeneralRe: count save Pin
led mike3-Apr-09 8:33
led mike3-Apr-09 8:33 
GeneralRe: count save Pin
Luc Pattyn3-Apr-09 8:49
sitebuilderLuc Pattyn3-Apr-09 8:49 
GeneralRe: count save Pin
dojohansen9-Apr-09 5:05
dojohansen9-Apr-09 5:05 
GeneralRe: count save Pin
kumarnitesh6-Apr-09 1:19
kumarnitesh6-Apr-09 1:19 
QuestionResolving the full type name Pin
Vipul Mehta3-Apr-09 2:46
Vipul Mehta3-Apr-09 2:46 
AnswerRe: Resolving the full type name Pin
Pete O'Hanlon3-Apr-09 3:07
mvePete O'Hanlon3-Apr-09 3:07 
AnswerRe: Resolving the full type name Pin
Vipul Mehta3-Apr-09 3:37
Vipul Mehta3-Apr-09 3:37 
QuestionIdea behind Chinese PinYin in c# Pin
dhanaid3-Apr-09 1:56
dhanaid3-Apr-09 1:56 
QuestionRe: Idea behind Chinese PinYin in c# Pin
dhanaid3-Apr-09 1:59
dhanaid3-Apr-09 1:59 
Question.NET Database Migrations Pin
AntonGogolev2-Apr-09 21:38
AntonGogolev2-Apr-09 21:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.