@@ -15,7 +15,7 @@ Kacarott - https://github.com/Kacarott
1515*/
1616
1717// Default options
18- const config = { verbosity : "Calm" // Calm | Concise | Loquacious | Verbose
18+ export const config = { verbosity : "Calm" // Calm | Concise | Loquacious | Verbose
1919 , purity : "Let" // Let | LetRec | PureLC
2020 , numEncoding : "Church" // None | Church | Scott | BinaryScott
2121 } ;
@@ -97,9 +97,9 @@ primitives.setThunk( "trace", new Tuple( Primitive( function(v) { console.info(S
9797
9898const 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" ) ) ) ) ) ) ;
9999
100- function fromInt ( n ) { return fromIntWith ( ) ( n ) ; }
100+ export function fromInt ( n ) { return fromIntWith ( ) ( n ) ; }
101101
102- function fromIntWith ( cfg = { } ) {
102+ export function fromIntWith ( cfg = { } ) {
103103 const { numEncoding, verbosity} = Object . assign ( { } , config , cfg ) ;
104104 return function fromInt ( n ) {
105105 if ( numEncoding === "Church" )
@@ -132,9 +132,9 @@ function fromIntWith(cfg={}) {
132132 } ;
133133}
134134
135- function toInt ( term ) { return toIntWith ( ) ( term ) ; }
135+ export function toInt ( term ) { return toIntWith ( ) ( term ) ; }
136136
137- function toIntWith ( cfg = { } ) {
137+ export function toIntWith ( cfg = { } ) {
138138 const { numEncoding, verbosity} = Object . assign ( { } , config , cfg ) ;
139139 return function toInt ( term ) {
140140 try {
@@ -314,9 +314,9 @@ function parseWith(cfg={}) {
314314 }
315315}
316316
317- function compile ( code ) { return compileWith ( ) ( code ) ; }
317+ export function compile ( code ) { return compileWith ( ) ( code ) ; }
318318
319- function compileWith ( cfg = { } ) {
319+ export function compileWith ( cfg = { } ) {
320320 const { numEncoding, purity, verbosity} = Object . assign ( { } , config , cfg ) ;
321321 return function compile ( code ) {
322322 if ( typeof code !== "string" || ! code ) throw new TypeError ( "missing code" ) ;
@@ -426,13 +426,3 @@ function printStackTrace(error, term, stack) { console.log("printStackTrace",con
426426}
427427
428428Object . 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