Skip to content

Commit 199dc17

Browse files
♻️ refactor: Remove most circular dependencies.
The only one left is between Integer and _from_number. Ideally, Integer will be written so that operations on single limbs are done more efficiently than by converting the single limb to an integer first. This would get rid of that last circular dependency.
1 parent 3bf51db commit 199dc17

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

src/Integer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import {DEFAULT_DISPLAY_BASE, ZeroDivisionError} from './index.js';
1+
import {DEFAULT_DISPLAY_BASE} from './DEFAULT_DISPLAY_BASE.js';
2+
import {ZeroDivisionError} from './ZeroDivisionError.js';
23

34
import {ValueError} from '@aureooms/js-error';
45

src/IntegerRing.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import {Integer, DEFAULT_DISPLAY_BASE} from './index.js';
2-
31
import {parse, convert} from '@aureooms/js-integer-big-endian';
42
import {TypeError, ValueError} from '@aureooms/js-error';
3+
4+
import {Integer} from './Integer.js';
5+
import {DEFAULT_DISPLAY_BASE} from './DEFAULT_DISPLAY_BASE.js';
56
import {_from_number} from './_from_number.js';
67

78
export class IntegerRing {

src/ZZ.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
import {DEFAULT_REPRESENTATION_BASE, IntegerRing} from './index.js';
1+
import {DEFAULT_REPRESENTATION_BASE} from './DEFAULT_REPRESENTATION_BASE.js';
2+
import {IntegerRing} from './IntegerRing.js';
23

34
export const ZZ = new IntegerRing('Integer Ring', DEFAULT_REPRESENTATION_BASE);

src/integer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import {DEFAULT_DISPLAY_BASE, ZZ} from './index.js';
1+
import {DEFAULT_DISPLAY_BASE} from './DEFAULT_DISPLAY_BASE.js';
2+
import {ZZ} from './ZZ.js';
23

34
export function $0() {
45
return ZZ.$0();

0 commit comments

Comments
 (0)