Hi,

you can use the second method, and then don't include it in the signature file. Or you may declare escape2regex as private as in

1
let private escape2regex = System.Text.RegularExpressions.Regex("[^a-zA-Z0-9_]")

which ensures this definition is only callable from within the module.

Making sure it is both declared private and missing from the signature file makes it easy to see which definition won't appear in the signature or is not callable from outside when you read the implementation file, and it avoids cluttering the signature file...

By on 7/8/2008 5:43 AM ()

Thanks Julien. That's probably the cleanest solution. Unfortunately, I'm a bit lazy with regard to writing and keeping up-to-date signature files...

Stephan

By on 7/9/2008 2:31 AM ()

A fairly recent addation to the language is that you can now use the "private" keyword instead of signature files:

1
let private x = "toto"

It's not that well documented but there is a section in the F# manual about it:
[link:research.microsoft.com]

Not sure if this is the prefered way of doing this or just an alterative to signature files.

By on 7/9/2008 4:05 AM ()

The problem with "private" declarations is that code completion doesn't yet filter them out.

By on 7/9/2008 5:13 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper