This repository was archived by the owner on Oct 12, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 411
Demphasize runtime hooks in object.d's documentation #2768
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,117 +38,12 @@ alias dstring = immutable(dchar)[]; | |
|
|
||
| version (D_ObjectiveC) public import core.attribute : selector; | ||
|
|
||
| /// See $(REF _d_cmain, core,internal,entrypoint) | ||
| public import core.internal.entrypoint : _d_cmain; | ||
|
|
||
| /// See $(REF _d_arrayappendTImpl, core,internal,array,appending) | ||
| public import core.internal.array.appending : _d_arrayappendTImpl; | ||
| /// See $(REF _d_arrayappendcTXImpl, core,internal,array,appending) | ||
| public import core.internal.array.appending : _d_arrayappendcTXImpl; | ||
| /// See $(REF __cmp, core,internal,array,comparison) | ||
| public import core.internal.array.comparison : __cmp; | ||
| /// See $(REF __equals, core,internal,array,equality) | ||
| public import core.internal.array.equality : __equals; | ||
| /// See $(REF __ArrayEq, core,internal,array,equality) | ||
| public import core.internal.array.equality : __ArrayEq; | ||
| /// See $(REF __ArrayCast, core,internal,array,casting) | ||
| public import core.internal.array.casting: __ArrayCast; | ||
| /// See $(REF _d_arraycatnTXImpl, core,internal,array,concatenation) | ||
| public import core.internal.array.concatenation : _d_arraycatnTXImpl; | ||
| /// See $(REF _d_arrayctor, core,internal,array,construction) | ||
| public import core.internal.array.construction : _d_arrayctor; | ||
| /// See $(REF _d_arraysetctor, core,internal,array,construction) | ||
| public import core.internal.array.construction : _d_arraysetctor; | ||
|
|
||
| /// See $(REF capacity, core,internal,array,capacity) | ||
| public import core.internal.array.capacity: capacity; | ||
| /// See $(REF reserve, core,internal,array,capacity) | ||
| public import core.internal.array.capacity: reserve; | ||
| /// See $(REF assumeSafeAppend, core,internal,array,capacity) | ||
| public import core.internal.array.capacity: assumeSafeAppend; | ||
| /// See $(REF _d_arraysetlengthTImpl, core,internal,array,capacity) | ||
| public import core.internal.array.capacity: _d_arraysetlengthTImpl; | ||
|
|
||
| /// See $(REF _d_assert_fail, core,internal,dassert) | ||
| public import core.internal.dassert: _d_assert_fail; | ||
|
|
||
| /// See $(REF __switch, core,internal,switch_) | ||
| public import core.internal.switch_: __switch; | ||
| /// See $(REF __switch_error, core,internal,switch_) | ||
| public import core.internal.switch_: __switch_error; | ||
|
|
||
| // Compare class and interface objects for ordering. | ||
| private int __cmp(Obj)(Obj lhs, Obj rhs) | ||
| if (is(Obj : Object)) | ||
| { | ||
| if (lhs is rhs) | ||
| return 0; | ||
| // Regard null references as always being "less than" | ||
| if (!lhs) | ||
| return -1; | ||
| if (!rhs) | ||
| return 1; | ||
| return lhs.opCmp(rhs); | ||
| } | ||
|
|
||
| // objects | ||
| @safe unittest | ||
| { | ||
| class C | ||
| { | ||
| int i; | ||
| this(int i) { this.i = i; } | ||
|
|
||
| override int opCmp(Object c) const @safe | ||
| { | ||
| return i - (cast(C)c).i; | ||
| } | ||
| } | ||
|
|
||
| auto c1 = new C(1); | ||
| auto c2 = new C(2); | ||
| assert(__cmp(c1, null) > 0); | ||
| assert(__cmp(null, c1) < 0); | ||
| assert(__cmp(c1, c1) == 0); | ||
| assert(__cmp(c1, c2) < 0); | ||
| assert(__cmp(c2, c1) > 0); | ||
|
|
||
| assert(__cmp([c1, c1][], [c2, c2][]) < 0); | ||
| assert(__cmp([c2, c2], [c1, c1]) > 0); | ||
| } | ||
|
|
||
| // structs | ||
| @safe unittest | ||
| { | ||
| struct C | ||
| { | ||
| ubyte i; | ||
| this(ubyte i) { this.i = i; } | ||
| } | ||
|
|
||
| auto c1 = C(1); | ||
| auto c2 = C(2); | ||
|
|
||
| assert(__cmp([c1, c1][], [c2, c2][]) < 0); | ||
| assert(__cmp([c2, c2], [c1, c1]) > 0); | ||
| assert(__cmp([c2, c2], [c2, c1]) > 0); | ||
| } | ||
|
|
||
| @safe unittest | ||
| { | ||
| auto a = "hello"c; | ||
|
|
||
| assert(a > "hel"); | ||
| assert(a >= "hel"); | ||
| assert(a < "helloo"); | ||
| assert(a <= "helloo"); | ||
| assert(a > "betty"); | ||
| assert(a >= "betty"); | ||
| assert(a == "hello"); | ||
| assert(a <= "hello"); | ||
| assert(a >= "hello"); | ||
| assert(a < "я"); | ||
| } | ||
|
|
||
| /** | ||
| * Recursively calls the `opPostMove` callbacks of a struct and its members if | ||
|
|
@@ -4178,3 +4073,108 @@ void __ArrayDtor(T)(T[] a) | |
| foreach_reverse (ref T e; a) | ||
| e.__xdtor(); | ||
| } | ||
|
|
||
| /// See $(REF _d_cmain, core,internal,entrypoint) | ||
| public import core.internal.entrypoint : _d_cmain; | ||
|
|
||
| /// See $(REF _d_arrayappendTImpl, core,internal,array,appending) | ||
| public import core.internal.array.appending : _d_arrayappendTImpl; | ||
| /// See $(REF _d_arrayappendcTXImpl, core,internal,array,appending) | ||
| public import core.internal.array.appending : _d_arrayappendcTXImpl; | ||
| /// See $(REF __cmp, core,internal,array,comparison) | ||
| public import core.internal.array.comparison : __cmp; | ||
| /// See $(REF __equals, core,internal,array,equality) | ||
| public import core.internal.array.equality : __equals; | ||
| /// See $(REF __ArrayEq, core,internal,array,equality) | ||
| public import core.internal.array.equality : __ArrayEq; | ||
| /// See $(REF __ArrayCast, core,internal,array,casting) | ||
| public import core.internal.array.casting: __ArrayCast; | ||
| /// See $(REF _d_arraycatnTXImpl, core,internal,array,concatenation) | ||
| public import core.internal.array.concatenation : _d_arraycatnTXImpl; | ||
| /// See $(REF _d_arrayctor, core,internal,array,construction) | ||
| public import core.internal.array.construction : _d_arrayctor; | ||
| /// See $(REF _d_arraysetctor, core,internal,array,construction) | ||
| public import core.internal.array.construction : _d_arraysetctor; | ||
| /// See $(REF _d_arraysetlengthTImpl, core,internal,array,capacity) | ||
| public import core.internal.array.capacity: _d_arraysetlengthTImpl; | ||
|
|
||
| /// See $(REF _d_assert_fail, core,internal,dassert) | ||
| public import core.internal.dassert: _d_assert_fail; | ||
|
|
||
| /// See $(REF __switch, core,internal,switch_) | ||
| public import core.internal.switch_: __switch; | ||
| /// See $(REF __switch_error, core,internal,switch_) | ||
| public import core.internal.switch_: __switch_error; | ||
|
|
||
| // Compare class and interface objects for ordering. | ||
| private int __cmp(Obj)(Obj lhs, Obj rhs) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks like another candidate for moving to |
||
| if (is(Obj : Object)) | ||
| { | ||
| if (lhs is rhs) | ||
| return 0; | ||
| // Regard null references as always being "less than" | ||
| if (!lhs) | ||
| return -1; | ||
| if (!rhs) | ||
| return 1; | ||
| return lhs.opCmp(rhs); | ||
| } | ||
|
|
||
| // objects | ||
| @safe unittest | ||
| { | ||
| class C | ||
| { | ||
| int i; | ||
| this(int i) { this.i = i; } | ||
|
|
||
| override int opCmp(Object c) const @safe | ||
| { | ||
| return i - (cast(C)c).i; | ||
| } | ||
| } | ||
|
|
||
| auto c1 = new C(1); | ||
| auto c2 = new C(2); | ||
| assert(__cmp(c1, null) > 0); | ||
| assert(__cmp(null, c1) < 0); | ||
| assert(__cmp(c1, c1) == 0); | ||
| assert(__cmp(c1, c2) < 0); | ||
| assert(__cmp(c2, c1) > 0); | ||
|
|
||
| assert(__cmp([c1, c1][], [c2, c2][]) < 0); | ||
| assert(__cmp([c2, c2], [c1, c1]) > 0); | ||
| } | ||
|
|
||
| // structs | ||
| @safe unittest | ||
| { | ||
| struct C | ||
| { | ||
| ubyte i; | ||
| this(ubyte i) { this.i = i; } | ||
| } | ||
|
|
||
| auto c1 = C(1); | ||
| auto c2 = C(2); | ||
|
|
||
| assert(__cmp([c1, c1][], [c2, c2][]) < 0); | ||
| assert(__cmp([c2, c2], [c1, c1]) > 0); | ||
| assert(__cmp([c2, c2], [c2, c1]) > 0); | ||
| } | ||
|
|
||
| @safe unittest | ||
| { | ||
| auto a = "hello"c; | ||
|
|
||
| assert(a > "hel"); | ||
| assert(a >= "hel"); | ||
| assert(a < "helloo"); | ||
| assert(a <= "helloo"); | ||
| assert(a > "betty"); | ||
| assert(a >= "betty"); | ||
| assert(a == "hello"); | ||
| assert(a <= "hello"); | ||
| assert(a >= "hello"); | ||
| assert(a < "я"); | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it makes sense to add a big comment along the lines of:
To better designate the file structure.