Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commiteff26cd

Browse files
committed
FX_NO_LAZY --- dead code
1 parent6ee58a9 commiteff26cd

File tree

2 files changed

+1
-116
lines changed

2 files changed

+1
-116
lines changed

‎src/fsharp/FSharp.Core/prim-types.fs‎

Lines changed: 1 addition & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -2824,15 +2824,6 @@ namespace Microsoft.FSharp.Core
28242824

28252825
letCheckedMultiplyDynamic<'T,'U,'V>x n= CheckedMultiplyDynamicImplTable<'T,'U,'V>.Impl x n
28262826

2827-
#if FX_NO_LAZY
2828-
2829-
typeinternalPrivateEnvironment=
2830-
static memberinternalGetResourceString(name:string,_arguments:obj[])= name
2831-
static memberinternalGetResourceString(name:string)= name
2832-
2833-
#else
2834-
#endif
2835-
28362827

28372828
namespaceSystem
28382829

@@ -6175,84 +6166,6 @@ namespace Microsoft.FSharp.Core
61756166
if n>=0then PowDecimal x nelse1.0M/ PowDecimal x n)
61766167

61776168

6178-
6179-
6180-
6181-
6182-
6183-
//============================================================================
6184-
//============================================================================
6185-
#if FX_NO_LAZY
6186-
namespaceSystem
6187-
openSystem.Diagnostics
6188-
openMicrosoft.FSharp.Core
6189-
openMicrosoft.FSharp.Core.Operators
6190-
6191-
6192-
typeLazyFailure(exn:exn)=
6193-
static letundefined= LazyFailure(InvalidOperationException("a lazy value was accessed during its own initialization"))
6194-
memberx.Exception= exn
6195-
static memberUndefined= undefined
6196-
6197-
[<AllowNullLiteral>]
6198-
typeLazy<'T>(value: 'T,funcOrException: obj)=
6199-
6200-
/// This field holds the result of a successful computation. It's initial value is Unchecked.defaultof
6201-
let mutablevalue= value
6202-
6203-
/// This field holds either the function to run or a LazyFailure object recording the exception raised
6204-
/// from running the function. It is null if the thunk has been evaluated successfully.
6205-
[<VolatileField>]
6206-
let mutablefuncOrException= funcOrException
6207-
6208-
static memberCreate(f:(unit->'T)):Lazy<'T>=
6209-
Lazy<'T>(value= Unchecked.defaultof<'T>, funcOrException= box(f))
6210-
static memberCreateFromValue(x:'T):Lazy<'T>=
6211-
Lazy<'T>(value= x, funcOrException=null)
6212-
memberx.IsValueCreated=(match funcOrExceptionwithnull->true|_->false)
6213-
memberx.Value=
6214-
match funcOrExceptionwith
6215-
|null-> value
6216-
|_->
6217-
// Enter the lock in case another thread is in the process of evaluating the result
6218-
System.Threading.Monitor.Enter(x);
6219-
try
6220-
match funcOrExceptionwith
6221-
|null-> value
6222-
|:? LazyFailureas res->
6223-
raise(res.Exception)
6224-
|:?(unit-> 'T)as f->
6225-
funcOrException<- box(LazyFailure.Undefined)
6226-
try
6227-
letres= f()
6228-
value<- res;
6229-
funcOrException<-null;
6230-
res
6231-
with e->
6232-
funcOrException<- box(new LazyFailure(e));
6233-
reraise()
6234-
|_->
6235-
failwith"unreachable"
6236-
finally
6237-
System.Threading.Monitor.Exit(x)
6238-
overridex.ToString()=
6239-
if x.IsValueCreatedthen
6240-
if box x.Value=nullthen
6241-
"<null>"
6242-
else
6243-
x.Value.ToString()
6244-
else
6245-
match funcOrExceptionwith
6246-
|:? LazyFailureas res->
6247-
match res.Exceptionwith
6248-
| ewhen System.Runtime.CompilerServices.RuntimeHelpers.Equals(e,LazyFailure.Undefined)->"<evaluating>"
6249-
| e-> e.ToString()
6250-
|_->
6251-
"<unevaluated>"
6252-
6253-
#else
6254-
#endif
6255-
62566169
namespaceMicrosoft.FSharp.Control
62576170

62586171
openSystem
@@ -6263,15 +6176,6 @@ namespace Microsoft.FSharp.Control
62636176

62646177
moduleLazyExtensions=
62656178
typeSystem.Lazy<'T>with
6266-
#if FX_NO_LAZY
6267-
[<CompiledName("Create")>]// give the extension member a 'nice', unmangled compiled name, unique within this module
6268-
static memberCreate(f:unit->'T):Lazy<'T>=
6269-
System.Lazy<'T>(value= Unchecked.defaultof<'T>, funcOrException= box(f))
6270-
6271-
[<CompiledName("CreateFromValue")>]// give the extension member a 'nice', unmangled compiled name, unique within this module
6272-
static memberCreateFromValue(x:'T):Lazy<'T>=
6273-
System.Lazy<'T>(value= x, funcOrException=null)
6274-
#else
62756179
[<CompiledName("Create")>]// give the extension member a 'nice', unmangled compiled name, unique within this module
62766180
static memberCreate(f:unit->'T):System.Lazy<'T>=
62776181
letcreator=new System.Func<'T>(f)
@@ -6280,7 +6184,7 @@ namespace Microsoft.FSharp.Control
62806184
[<CompiledName("CreateFromValue")>]// give the extension member a 'nice', unmangled compiled name, unique within this module
62816185
static memberCreateFromValue(value:'T):System.Lazy<'T>=
62826186
System.Lazy<'T>.Create(fun()-> value)
6283-
#endif
6187+
62846188
[<CompiledName("IsDelayedDeprecated")>]// give the extension member a 'nice', unmangled compiled name, unique within this module
62856189
memberx.IsDelayed=not(x.IsValueCreated)
62866190

‎src/fsharp/FSharp.Core/prim-types.fsi‎

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3306,25 +3306,6 @@ namespace Microsoft.FSharp.Core
33063306
val nanf<[<Measure>] 'Measure>:float32<'Measure>
33073307
#endif
33083308

3309-
3310-
#if FX_NO_LAZY
3311-
namespace System
3312-
open System.Diagnostics
3313-
open Microsoft.FSharp.Core
3314-
open Microsoft.FSharp.Core.Operators
3315-
3316-
///<summary>Encapsulates a lazily computed value.</summary>
3317-
[<Class>]
3318-
[<AllowNullLiteral>]
3319-
type Lazy<'T>=
3320-
///<summary>Is true if the value is ready to be accessed.</summary>
3321-
member IsValueCreated:bool
3322-
///<summary>The value contained in the Lazy.</summary>
3323-
member Value: 'T
3324-
#else
3325-
#endif
3326-
3327-
33283309
namespace Microsoft.FSharp.Control
33293310
open Microsoft.FSharp.Core
33303311

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp