Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6898087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:15:06+00:00 2026-05-27T07:15:06+00:00

module FSharp= let Point2d (x,y)= Point2d(x,y) let Point3d (x,y,z)= Point3d(x,y,z) type NXOpen.Point3d with static

  • 0
module FSharp=
let Point2d (x,y)= Point2d(x,y)
let Point3d (x,y,z)= Point3d(x,y,z)
type NXOpen.Point3d with
    static member ( * ) (p:Point3d,t:float)= Point3d(p.X*t,p.Y*t,p.Z*t)
    static member ( * ) (t:float,p:Point3d)= Point3d(p.X*t,p.Y*t,p.Z*t)
    static member (+) (p:Point3d,t:float)= Point3d(p.X+t,p.Y+t,p.Z+t)
    static member (+) (t:float,p:Point3d)= Point3d(p.X+t,p.Y+t,p.Z+t)
    static member (+) (p:Point3d,t:Point3d)= Point3d(p.X+t.X,p.Y+t.Y,p.Z+t.Z)

let a=Point3d (1.,2.,3.)
let b=1.0
let c=a * b//error

Error 15: The type ‘float’ does not match the type
‘Point3d’ E:\Work\extension-RW\VS\extension\NXOpen.Extension.FSharp\Module1.fs 18 13 NXOpen.Extension.FSharp

I want to extend the Point3d methods, some new operators. But it doesn’t pass over.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:15:06+00:00Added an answer on May 27, 2026 at 7:15 am

    Indeed it is possible.
    There is a way to extend binary operators using the one and only and little known ternary operator ?<-. So in your case you can try this:

    type SumPoint3d = SumPoint3d with
        static member        (?<-) (p:Point3d, SumPoint3d, t        ) = Point3d(p.X + t  , p.Y + t  , p.Z + t  )
        static member        (?<-) (t        , SumPoint3d, p:Point3d) = Point3d(p.X + t  , p.Y + t  , p.Z + t  )
        static member        (?<-) (p:Point3d, SumPoint3d, t:Point3d) = Point3d(p.X + t.X, p.Y + t.Y, p.Z + t.Z)
        static member inline (?<-) (a        , SumPoint3d, b        ) = a + b
    
    type ProdPoint3d = ProdPoint3d with    
        static member        (?<-) (p:Point3d, ProdPoint3d, t        ) = Point3d(p.X * t, p.Y * t, p.Z * t)
        static member        (?<-) (t        , ProdPoint3d, p:Point3d) = Point3d(p.X * t, p.Y * t, p.Z * t)
        static member inline (?<-) (a        , ProdPoint3d, b        ) = a * b
    
    let inline ( + ) a b =  a ? (SumPoint3d ) <- b
    let inline ( * ) a b =  a ? (ProdPoint3d) <- b
    
    let a=Point3d (1.,2.,3.) 
    let b=1.0
    

    Now you can try:

    > let c=a * b ;;
    val c : Point3d = Point3d (1.0,2.0,3.0)
    
    >  2 * 3 ;;
    val it : int = 6
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this module does a good job at creating a tagcloud block - all good
I'd like a module to install some content, for instance add some static blocks
My fsyacc code is giving a compiler error saying a variable is not found,
module PRO where average1 :: IO Float avarage1 = do putStrLn Enter Marks in
I'm importing a module which raises the following error in some conditions: RuntimeError: pyparted
module Algorithm where import System.Random import Data.Maybe import Data.List type Atom = String type
Bug or Am I doing something wrong ? Error 13 The namespace or module
Module Data.ByteString.Lazy contain own implementation of ByteString type: data ByteString = Empty | Chunk
module <name> = struct .. end;; module type <name> = struct (* should have
module type ELEMENT = sig type element_i end module Element:ELEMENT = struct type element_i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.