Skip to content

Commit db16125

Browse files
💥 BREAKING CHANGE: Simplify API.
1 parent 4bbbb22 commit db16125

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

doc/manual/example.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
```js
44
import { _add , _sub , _mul , _div } from '@aureooms/js-rational' ;
55
import * as integer from '@aureooms/js-integer' ;
6-
const add = _add( integer.mul , integer.add ) ;
7-
const sub = _sub( integer.mul , integer.sub ) ;
8-
const mul = _mul( integer.mul ) ;
9-
const div = _div( integer.mul ) ;
6+
const add = _add( integer ) ;
7+
const sub = _sub( integer ) ;
8+
const mul = _mul( integer ) ;
9+
const div = _div( integer ) ;
1010
```

src/add.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Dummy add template.
44
*/
55

6-
export function _add ( mul , add ) {
6+
export function _add ( { mul , add } ) {
77

88
return function ( a0 , a1 , b0 , b1 ) {
99

src/div.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Dummy div template.
44
*/
55

6-
export function _div ( mul ) {
6+
export function _div ( { mul } ) {
77

88
return function ( a0 , a1 , b0 , b1 ) {
99

src/mul.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Dummy mul template.
44
*/
55

6-
export function _mul ( mul ) {
6+
export function _mul ( { mul } ) {
77

88
return function ( a0 , a1 , b0 , b1 ) {
99

src/sub.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Dummy sub template.
44
*/
55

6-
export function _sub ( mul , sub ) {
6+
export function _sub ( { mul , sub } ) {
77

88
return function ( a0 , a1 , b0 , b1 ) {
99

test/src/core.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ const ALU = [
6060
}
6161
];
6262

63-
const add = [ 'add' , '+' , '_add' , alu => _add( alu.mul , alu.add ) ] ;
64-
const sub = [ 'sub' , '-' , '_sub' , alu => _sub( alu.mul , alu.sub ) ] ;
65-
const mul = [ 'mul' , '*' , '_mul' , alu => _mul( alu.mul ) ] ;
66-
const div = [ 'div' , '/' , '_div' , alu => _div( alu.mul ) ] ;
63+
const add = [ 'add' , '+' , '_add' , alu => _add( alu ) ] ;
64+
const sub = [ 'sub' , '-' , '_sub' , alu => _sub( alu ) ] ;
65+
const mul = [ 'mul' , '*' , '_mul' , alu => _mul( alu ) ] ;
66+
const div = [ 'div' , '/' , '_div' , alu => _div( alu ) ] ;
6767
const cmp = [ 'cmp' , '~' , '_cmp' , alu => _cmp( alu ) ] ;
6868

6969
const PARAMS = [

0 commit comments

Comments
 (0)