nendo 0.6.4 → 0.6.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -59,13 +59,13 @@ trampCall(
59
59
  end
60
60
  } ; ___lambda.call(
61
61
  begin
62
- ___lambda = lambda { |___gensym__5d616449e4cd5ff7562e60dbfcf1c628e32cc41d_30170|
62
+ ___lambda = lambda { |___gensym__5d616449e4cd5ff7562e60dbfcf1c628e32cc41d_30178|
63
63
  if (
64
64
  begin
65
65
  embedBacktraceInfo( "./lib/nendo/nendo/test.nnd", 175 );
66
66
  _null_QUMARK(
67
67
  begin
68
- trampCall(___gensym__5d616449e4cd5ff7562e60dbfcf1c628e32cc41d_30170)
68
+ trampCall(___gensym__5d616449e4cd5ff7562e60dbfcf1c628e32cc41d_30178)
69
69
  rescue => __e ; __e.set_backtrace( [":1"] + __e.backtrace ) ; raise __e
70
70
  end
71
71
  )
@@ -84,7 +84,7 @@ trampCall(
84
84
  end ,
85
85
  [
86
86
  begin
87
- trampCall(___gensym__5d616449e4cd5ff7562e60dbfcf1c628e32cc41d_30170)
87
+ trampCall(___gensym__5d616449e4cd5ff7562e60dbfcf1c628e32cc41d_30178)
88
88
  rescue => __e ; __e.set_backtrace( [":1"] + __e.backtrace ) ; raise __e
89
89
  end
90
90
  ]
@@ -140,7 +140,7 @@ trampCall(
140
140
  begin
141
141
  if (
142
142
  begin
143
- embedBacktraceInfo( "./lib/nendo/nendo/experimental.nnd", 39 );
143
+ embedBacktraceInfo( "./lib/nendo/nendo/experimental.nnd", 265 );
144
144
  _not(
145
145
  begin
146
146
  embedBacktraceInfo( "./lib/nendo/nendo/test.nnd", 52 );
@@ -172,7 +172,7 @@ trampCall(
172
172
  ___lambda = lambda { |_ex,_ey|
173
173
  if (
174
174
  begin
175
- embedBacktraceInfo( "./lib/nendo/nendo/experimental.nnd", 39 );
175
+ embedBacktraceInfo( "./lib/nendo/nendo/experimental.nnd", 265 );
176
176
  _not(
177
177
  begin
178
178
  embedBacktraceInfo( "./lib/nendo/nendo/test.nnd", 52 );
@@ -734,7 +734,7 @@ trampCall(
734
734
  if (
735
735
  if (
736
736
  begin
737
- embedBacktraceInfo( "./lib/nendo/nendo/experimental.nnd", 39 );
737
+ embedBacktraceInfo( "./lib/nendo/nendo/experimental.nnd", 265 );
738
738
  _not(
739
739
  begin
740
740
  embedBacktraceInfo( "./lib/nendo/nendo/test.nnd", 52 );
@@ -1389,13 +1389,13 @@ trampCall(
1389
1389
  ) then
1390
1390
  begin
1391
1391
  begin
1392
- embedBacktraceInfo( "./lib/nendo/nendo/experimental.nnd", 132 );
1392
+ embedBacktraceInfo( "./lib/nendo/nendo/experimental.nnd", 186 );
1393
1393
  trampCall( self.__PAMARKraise_METHOD( '%raise',
1394
1394
  begin
1395
1395
  if @global_lisp_binding.has_key?('__PAMARKraise') then
1396
1396
  trampCall(@__PAMARKraise)
1397
1397
  else raise NameError.new( "Error: undefined variable __PAMARKraise", "__PAMARKraise" ) end
1398
- rescue => __e ; __e.set_backtrace( ["./lib/nendo/nendo/experimental.nnd:132"] + __e.backtrace ) ; raise __e
1398
+ rescue => __e ; __e.set_backtrace( ["./lib/nendo/nendo/experimental.nnd:186"] + __e.backtrace ) ; raise __e
1399
1399
  end ,
1400
1400
  [
1401
1401
  begin
@@ -1414,26 +1414,26 @@ trampCall(
1414
1414
  [
1415
1415
  "%s:%s raised %s" ,
1416
1416
  begin
1417
- embedBacktraceInfo( "./lib/nendo/nendo/experimental.nnd", 130 );
1417
+ embedBacktraceInfo( "./lib/nendo/nendo/experimental.nnd", 184 );
1418
1418
  trampCall( self.__ASMARKFILE_ASMARK_METHOD( '*FILE*',
1419
1419
  begin
1420
1420
  if @global_lisp_binding.has_key?('__ASMARKFILE_ASMARK') then
1421
1421
  trampCall(@__ASMARKFILE_ASMARK)
1422
1422
  else raise NameError.new( "Error: undefined variable __ASMARKFILE_ASMARK", "__ASMARKFILE_ASMARK" ) end
1423
- rescue => __e ; __e.set_backtrace( ["./lib/nendo/nendo/experimental.nnd:130"] + __e.backtrace ) ; raise __e
1423
+ rescue => __e ; __e.set_backtrace( ["./lib/nendo/nendo/experimental.nnd:184"] + __e.backtrace ) ; raise __e
1424
1424
  end ,
1425
1425
  [
1426
1426
  ]
1427
1427
  ))
1428
1428
  end ,
1429
1429
  begin
1430
- embedBacktraceInfo( "./lib/nendo/nendo/experimental.nnd", 130 );
1430
+ embedBacktraceInfo( "./lib/nendo/nendo/experimental.nnd", 184 );
1431
1431
  trampCall( self.__ASMARKLINE_ASMARK_METHOD( '*LINE*',
1432
1432
  begin
1433
1433
  if @global_lisp_binding.has_key?('__ASMARKLINE_ASMARK') then
1434
1434
  trampCall(@__ASMARKLINE_ASMARK)
1435
1435
  else raise NameError.new( "Error: undefined variable __ASMARKLINE_ASMARK", "__ASMARKLINE_ASMARK" ) end
1436
- rescue => __e ; __e.set_backtrace( ["./lib/nendo/nendo/experimental.nnd:130"] + __e.backtrace ) ; raise __e
1436
+ rescue => __e ; __e.set_backtrace( ["./lib/nendo/nendo/experimental.nnd:184"] + __e.backtrace ) ; raise __e
1437
1437
  end ,
1438
1438
  [
1439
1439
  ]
@@ -1458,26 +1458,26 @@ trampCall(
1458
1458
  [
1459
1459
  "%s:%s raised %s" ,
1460
1460
  begin
1461
- embedBacktraceInfo( "./lib/nendo/nendo/experimental.nnd", 130 );
1461
+ embedBacktraceInfo( "./lib/nendo/nendo/experimental.nnd", 184 );
1462
1462
  trampCall( self.__ASMARKFILE_ASMARK_METHOD( '*FILE*',
1463
1463
  begin
1464
1464
  if @global_lisp_binding.has_key?('__ASMARKFILE_ASMARK') then
1465
1465
  trampCall(@__ASMARKFILE_ASMARK)
1466
1466
  else raise NameError.new( "Error: undefined variable __ASMARKFILE_ASMARK", "__ASMARKFILE_ASMARK" ) end
1467
- rescue => __e ; __e.set_backtrace( ["./lib/nendo/nendo/experimental.nnd:130"] + __e.backtrace ) ; raise __e
1467
+ rescue => __e ; __e.set_backtrace( ["./lib/nendo/nendo/experimental.nnd:184"] + __e.backtrace ) ; raise __e
1468
1468
  end ,
1469
1469
  [
1470
1470
  ]
1471
1471
  ))
1472
1472
  end ,
1473
1473
  begin
1474
- embedBacktraceInfo( "./lib/nendo/nendo/experimental.nnd", 130 );
1474
+ embedBacktraceInfo( "./lib/nendo/nendo/experimental.nnd", 184 );
1475
1475
  trampCall( self.__ASMARKLINE_ASMARK_METHOD( '*LINE*',
1476
1476
  begin
1477
1477
  if @global_lisp_binding.has_key?('__ASMARKLINE_ASMARK') then
1478
1478
  trampCall(@__ASMARKLINE_ASMARK)
1479
1479
  else raise NameError.new( "Error: undefined variable __ASMARKLINE_ASMARK", "__ASMARKLINE_ASMARK" ) end
1480
- rescue => __e ; __e.set_backtrace( ["./lib/nendo/nendo/experimental.nnd:130"] + __e.backtrace ) ; raise __e
1480
+ rescue => __e ; __e.set_backtrace( ["./lib/nendo/nendo/experimental.nnd:184"] + __e.backtrace ) ; raise __e
1481
1481
  end ,
1482
1482
  [
1483
1483
  ]
@@ -553,13 +553,13 @@ trampCall(
553
553
  end
554
554
  } ; ___lambda.call(
555
555
  begin
556
- ___lambda = lambda { |___gensym__6d159efe5170a605fc9e84dcf91a427e3f7e5718_90180|
556
+ ___lambda = lambda { |___gensym__6d159efe5170a605fc9e84dcf91a427e3f7e5718_90188|
557
557
  if (
558
558
  begin
559
559
  embedBacktraceInfo( "./lib/nendo/rfc/json.nnd", 62 );
560
560
  _null_QUMARK(
561
561
  begin
562
- trampCall(___gensym__6d159efe5170a605fc9e84dcf91a427e3f7e5718_90180)
562
+ trampCall(___gensym__6d159efe5170a605fc9e84dcf91a427e3f7e5718_90188)
563
563
  rescue => __e ; __e.set_backtrace( [":1"] + __e.backtrace ) ; raise __e
564
564
  end
565
565
  )
@@ -581,7 +581,7 @@ trampCall(
581
581
  end ,
582
582
  [
583
583
  begin
584
- trampCall(___gensym__6d159efe5170a605fc9e84dcf91a427e3f7e5718_90180)
584
+ trampCall(___gensym__6d159efe5170a605fc9e84dcf91a427e3f7e5718_90188)
585
585
  rescue => __e ; __e.set_backtrace( [":1"] + __e.backtrace ) ; raise __e
586
586
  end
587
587
  ]
@@ -671,13 +671,13 @@ trampCall(
671
671
  end
672
672
  } ; ___lambda.call(
673
673
  begin
674
- ___lambda = lambda { |___gensym__6d159efe5170a605fc9e84dcf91a427e3f7e5718_90181|
674
+ ___lambda = lambda { |___gensym__6d159efe5170a605fc9e84dcf91a427e3f7e5718_90189|
675
675
  if (
676
676
  begin
677
677
  embedBacktraceInfo( "./lib/nendo/rfc/json.nnd", 62 );
678
678
  _null_QUMARK(
679
679
  begin
680
- trampCall(___gensym__6d159efe5170a605fc9e84dcf91a427e3f7e5718_90181)
680
+ trampCall(___gensym__6d159efe5170a605fc9e84dcf91a427e3f7e5718_90189)
681
681
  rescue => __e ; __e.set_backtrace( [":1"] + __e.backtrace ) ; raise __e
682
682
  end
683
683
  )
@@ -699,7 +699,7 @@ trampCall(
699
699
  end ,
700
700
  [
701
701
  begin
702
- trampCall(___gensym__6d159efe5170a605fc9e84dcf91a427e3f7e5718_90181)
702
+ trampCall(___gensym__6d159efe5170a605fc9e84dcf91a427e3f7e5718_90189)
703
703
  rescue => __e ; __e.set_backtrace( [":1"] + __e.backtrace ) ; raise __e
704
704
  end
705
705
  ]
@@ -344,6 +344,8 @@ module Nendo
344
344
  def _to_list( arg ) _to_MIMARKlist( arg ) end
345
345
  def _to_MIMARKlist( arg )
346
346
  case arg
347
+ when Enumerator
348
+ arg.to_list
347
349
  when Array
348
350
  arg.to_list
349
351
  when Cell
@@ -42,7 +42,7 @@ module Nendo
42
42
  end
43
43
 
44
44
  def self.version
45
- "0.6.4" ##NENDO-VERSION
45
+ "0.6.5" ##NENDO-VERSION
46
46
  end
47
47
 
48
48
  attr_reader :evaluator
@@ -101,6 +101,8 @@ module Nendo
101
101
  "()"
102
102
  when nil
103
103
  "nil"
104
+ when Hash
105
+ sexp.to_s
104
106
  else
105
107
  sprintf( "%s", sexp )
106
108
  end
data/lib/nendo/srfi-1.nnd CHANGED
@@ -657,10 +657,8 @@
657
657
  (if (null? cars+ans) ans ; Done.
658
658
  (lp cdrs (apply kons cars+ans)))))
659
659
 
660
- (let lp ((lis lis1) (ans knil)) ; Fast path
661
- (if (null-list? lis) ans
662
- (lp (cdr lis) (kons (car lis) ans))))))
663
-
660
+ ;; Fast path
661
+ (%fold kons knil lis1)))
664
662
 
665
663
  (define (fold-right kons knil lis1 . lists)
666
664
  (check-arg procedure? kons fold-right)
@@ -809,9 +807,26 @@
809
807
  ;; Fast path.
810
808
  (%map f lis1)))
811
809
 
810
+
811
+ ;;; For-each F across lists, guaranteeing to go left-to-right.
812
+ ;;; same like as map-in-order.
813
+
814
+ (define (for-each-in-order f lis1 . lists)
815
+ (check-arg procedure? f map-in-order)
816
+ (if (pair? lists)
817
+ (let recur ((lists (cons lis1 lists)))
818
+ (receive (cars cdrs) (%cars+cdrs lists)
819
+ (if (pair? cars)
820
+ (let ((x (apply f cars))) ; Do head first,
821
+ (cons x (recur cdrs))) ; then tail.
822
+ '())))
823
+
824
+ ;; Fast path.
825
+ (%for-each f lis1)))
826
+
812
827
  ;;; We extend MAP to handle arguments of unequal length.
813
828
  (define map map-in-order)
814
- (define for-each map-in-order)
829
+ (define for-each for-each-in-order)
815
830
 
816
831
  ;;; filter, remove, partition
817
832
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;