@@ -15,7 +15,7 @@ Kacarott - https://github.com/Kacarott
15
15
*/
16
16
17
17
// Default options
18
- const config = { verbosity : "Calm" // Calm | Concise | Loquacious | Verbose
18
+ export const config = { verbosity : "Calm" // Calm | Concise | Loquacious | Verbose
19
19
, purity : "Let" // Let | LetRec | PureLC
20
20
, numEncoding : "Church" // None | Church | Scott | BinaryScott
21
21
} ;
@@ -97,9 +97,9 @@ primitives.setThunk( "trace", new Tuple( Primitive( function(v) { console.info(S
97
97
98
98
const Y = new L ( "f" , new A ( new L ( "x" , new A ( new V ( "f" ) , new A ( new V ( "x" ) , new V ( "x" ) ) ) ) , new L ( "x" , new A ( new V ( "f" ) , new A ( new V ( "x" ) , new V ( "x" ) ) ) ) ) ) ;
99
99
100
- function fromInt ( n ) { return fromIntWith ( ) ( n ) ; }
100
+ export function fromInt ( n ) { return fromIntWith ( ) ( n ) ; }
101
101
102
- function fromIntWith ( cfg = { } ) {
102
+ export function fromIntWith ( cfg = { } ) {
103
103
const { numEncoding, verbosity} = Object . assign ( { } , config , cfg ) ;
104
104
return function fromInt ( n ) {
105
105
if ( numEncoding === "Church" )
@@ -132,9 +132,9 @@ function fromIntWith(cfg={}) {
132
132
} ;
133
133
}
134
134
135
- function toInt ( term ) { return toIntWith ( ) ( term ) ; }
135
+ export function toInt ( term ) { return toIntWith ( ) ( term ) ; }
136
136
137
- function toIntWith ( cfg = { } ) {
137
+ export function toIntWith ( cfg = { } ) {
138
138
const { numEncoding, verbosity} = Object . assign ( { } , config , cfg ) ;
139
139
return function toInt ( term ) {
140
140
try {
@@ -314,9 +314,9 @@ function parseWith(cfg={}) {
314
314
}
315
315
}
316
316
317
- function compile ( code ) { return compileWith ( ) ( code ) ; }
317
+ export function compile ( code ) { return compileWith ( ) ( code ) ; }
318
318
319
- function compileWith ( cfg = { } ) {
319
+ export function compileWith ( cfg = { } ) {
320
320
const { numEncoding, purity, verbosity} = Object . assign ( { } , config , cfg ) ;
321
321
return function compile ( code ) {
322
322
if ( typeof code !== "string" || ! code ) throw new TypeError ( "missing code" ) ;
@@ -426,13 +426,3 @@ function printStackTrace(error, term, stack) { console.log("printStackTrace",con
426
426
}
427
427
428
428
Object . defineProperty ( Function . prototype , "valueOf" , { value : function valueOf ( ) { return toInt ( this ) ; } } ) ;
429
-
430
- export {
431
- config ,
432
- compile ,
433
- compileWith ,
434
- fromInt ,
435
- fromIntWith ,
436
- toInt ,
437
- toIntWith ,
438
- } ;
0 commit comments