2011-01-07 13 views
4

私はF#レコードを使いたいと思っています。レースとランナーはレースを参照しています。ランナーとランナーはレースを参照しています。レギュラークラスと同じように、これはレコードで可能ですか?F#レコードは循環参照A - > B - > Aをサポートしていますか?

type Race = { 
    raceIdentifier : int 
    carriedWeightMean : decimal 
    prizeMoneyPercentileCountry : int64 
    noOfHorses : int 
    runners : Runner list 
} 

type Runner = { 
    horseId : int 
    finishPositionSequence : int64 
    lbw : decimal 
    horseNumberOfRaces : int 
    mutable race : Race 
} 

私はキーワード「と」を使用して試してみたが、これは動作していないようです:ない「で」、あなたがしたい

type Race = { 
    raceIdentifier : int 
    carriedWeightMean : decimal 
    prizeMoneyPercentileCountry : int64 
    noOfHorses : int 
    race : Race 
} with Runner = { 
    horseId : int 
    finishPositionSequence : int64 
    lbw : decimal 
    horseNumberOfRaces : int 
    race : Race 
} 

答えて

7

「と」。 ..

+0

コンピュータから離れる... – gradbot

+0

私は今、Windowsの電話を持っている、コンピュータにする必要はありません。今、キーボードでバックティックを入力するしか方法がわからないのですが、今、私は止められません:) – Brian

+0

低レイテンシのスタックオーバーフロー – jlezard

関連する問題