forked from shirok/Gauche
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChangeLog
16015 lines (11585 loc) · 603 KB
/
ChangeLog
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
2014-03-20 Shiro Kawai <shiro@acm.org>
* lib/www/css.scm: Added. Still experimental.
2014-03-06 Shiro Kawai <shiro@acm.org>
* ext/tls/tls.c, ext/tls/tls.scm (tls-destroy): Added explicit
destruction of TLS context. An axtls context grabs an fd for
/dev/urandom, and sometimes GC isn't triggered often enough
before unfinalized contexts use up all fds.
* lib/rfc/http.scm (shutdown-secure-agent): Destroy TLS context.
2014-03-01 Shiro Kawai <shiro@acm.org>
* src/system.c (Scm_ClockGetTimeMonotonic, Scm_ClockGetResMonotonic),
src/libsys.scm (sys-clock-gettime-monotonic, sys-clock-getres-monotonic):
Added monotonic time clock to be used for TAI time. If the system
doesn't provide clock_gettime()/clock_getres(), these API return
special values, so that the caller can make up whatever fallback
values suitable for their needs; the gist is that it's often easier
to implement fallback in Scheme.
2014-02-27 Shiro Kawai <shiro@acm.org>
* src/libfmt.scm (with-format-params): Fixed a bug in 'v' formatter
parameter handling; we shouldn't set! to the variable for the
parameter, since a formatter can be called multiple times and
every time we should fetch from the arglist.
2014-02-22 Shiro Kawai <shiro@acm.org>
* lib/r7rs.scm (gauche.base): Added gauche.base module to allow
R7RS programs to access Gauche's builtin bindings by
(import (gauche base)). See the comment for the reason we don't
simply export bindings from the gauche module.
2014-02-20 Shiro Kawai <shiro@acm.org>
* src/libeval.scm (%repl-print): Changed to use write (r7rs write,
which doesn't show shared structure but does show cycles) in the
default REPL. Showing shared structure by default has been a source
of confision for newcomers; now we can avoid that, yet we can
retain circular-safety.
2014-02-13 Shiro Kawai <shiro@acm.org>
* ext/peg/peg.scm: Consolidated $<< and $fmap and renamed to $lift.
Allow $->rope, $->string, $->symbol to take multiple parsers.
* lib/rfc/json.scm: Changed accordingly.
2014-02-11 Shiro Kawai <shiro@acm.org>
* src/gauche-package.in: Switched using Gauche-based configure
script by default in 'gauche-package generate',
unless --autoconf option is given.
* lib/gauche/configure.scm: Added cf-arg-with, cf-arg-enable, and
cf-help-string. Put more stuff in usage.
* src/libmisc.scm (warn), src/error.c (Scm_FWarn): Rewrote 'warn'
in Scheme, avoiding calling obsoleted Scm_Format. Also obsoleted
Scm_FWarn.
2014-02-10 Shiro Kawai <shiro@acm.org>
* src/libmod.scm (import): Added user#import that dispatches either
gauche#import or r7rs#import, to support r7rs script natively.
2014-02-07 Shiro Kawai <shiro@acm.org>
* src/number.c (Scm_NumCmp): Fixed Scm_NumCmp when comparing a flonum
and an exact bignum or ratnum. In that case we need to convert
the flonum to exact (as opposed to converting exact one to inexact),
for the latter would break transitivity of '='.
2014-02-06 Shiro Kawai <shiro@acm.org>
* src/core.c (init_cond_features): Added r7rs feature identifier.
* src/write.c, src/libio.scm: Changed the default behavior of
'Scm_Write' and 'write' alinged to r7rs, that is, it detects
circular structures and use datum labels. 'Display' also does
2-pass circular detection. The original 'write' behavior
is realized by 'write-simple'. SRFI-38 behavior is still
realized by write/ss and write*, which are merely alises of
r7rs 'write-shared'.
The 'mode' of Scm_Write and ScmWriteContext is slightly modified
to adopt this change; now, SCM_WRITE_WRITE works as the updated
'write' (circular-safe), and SCM_WRITE_SHARED works as 'write-shared'.
To get 'write-simple' behavior you have to specify SCM_WRITE_SIMPLE.
To distinguish circular-only and shared mode, we have to
add that info to the port flags as well, for the write context
info isn't passed to the user-defined write-object. SCM_PORT_WRITESS
flag is used for the purpose (the meaning of flag has been
changed).
2014-02-05 Shiro Kawai <shiro@acm.org>
* src/read.c (char_word_constituent): Refined checking symbol
constituent characters beyond ASCII range, following R6RS.
For example, \u3000 followed by 'a' used to be a part of
symbol, but now it correctly delimits a symbol 'a'.
2014-02-04 Shiro Kawai <shiro@acm.org>
* src/write.c, src/libfmt.scm (format): Rewrote format in Scheme.
NB: We might reconsider the semantics of format/ss; the output
of format is usually unreadable by 'read', so using srfi-38
notation isn't really a point. The point of format/ss is to
guarantee that it returns even if the arg has circular structure.
2014-02-02 Shiro Kawai <shiro@acm.org>
* src/port.c, src/libio.scm (with-port-locking): Moved the definition
from C to Scheme.
* src/write.c, src/port.c, src/portapi.c, src/read.c: Another step
to improve the writer. Now we don't create a dummy 'walker' port,
for merely marking the port->flags suffice. Also placed a cleanup
procedure to remove transient stuff from the port.
2014-02-01 Shiro Kawai <shiro@acm.org>
* src/boolean.c (Scm_EqualP), src/libbool.scm (%interleave-equal?):
Made equal? to handle cyclic structures, as specified in R[67]RS.
For the time being, we don't consider cycles involving user-defined
objects and object-equal? method.
* src/vminsn.scm (LREF-UNBOX): Added.
2014-01-31 Shiro Kawai <shiro@acm.org>
* src/code.c, src/vminsn.scm, src/geninsn, lib/gauche/vm/insn-core.scm:
The instruction combiner now allows preceding specialized LREFs
such as LREF0 or LREF21 to be combined into generic LREF-STNG(n,m)
(instead of having LREF0-STNG, LREF21-STNG, etc. separately).
Such combined insn is indicated by :fold-lref flag.
2014-01-30 Shiro Kawai <shiro@acm.org>
* src/vm.c, src/vminsn.scm (UNBOX), src/compile.scm: Finishing explicit
boxing/unboxing. NB: Although this fix makes the compile emit
necessary BOX/UNBOX instructions for set!-table lvars, we do not
drop implicit unboxing feature yet, since 0.9.4 compiler and runtime
are compiled by 0.9.3.3 compiler that doesn't emit UNBOX insns.
See the comment about auto-unboxing in vm.c; we'll remove
auto-unboxing stuff once we release 0.9.4.
* test-0.9.4.sh: A temporary shell script to test BOX/UNBOX stuff.
Ordinary test run doesn't test this, since 0.9.4 build still use
implicit unboxing. This shell script build 0.9.4, then build it
again _using_0.9.4_compiler_, so that we can test BOX/UNBOX thingy.
We'll remove this script once we release 0.9.4.
2014-01-28 Shiro Kawai <shiro@acm.org>
* src/vminsn.scm (BOX): Changed to be used to box procedure parameters.
(ENV-SET): New instruction to initialize env slot (used with
LOCAL-ENV-CLOSURES). We used to use LSET, but we'll box all
set!-able lvars and LSET will do set-box! instead of directly setting
env slot.
* src/compile.scm: Changed to emit ENV-SET and new BOX insn.
* src/geninsn, lib/gauche/vm/insn-core.scm: Allow insn definitions
to have alternative num-params, so that we can build Gauche
using the previous version of Gauche even if we change the
num-params of insns.
2014-01-27 Shiro Kawai <shiro@acm.org>
* lib/www/cgi.scm (read-complete-block): Fixed a bug in the case
when content-length is zero.
2014-01-19 Shiro Kawai <shiro@acm.org>
* src/gauche/vm.h (ScmContFrame): Added a slot to save current PC.
This isn't needed for execution, but useful to get a sensible
stack trace.
In a sense, this info records "who created this continuation?".
A concern is the impact on the performance, for we have one extra word
to push for each continuation. Let's see how it goes.
2014-01-12 Shiro Kawai <shiro@acm.org>
* src/write.c: Rewriting to clean up the control flow regarding recursive
situation. The recursive context should be solely held in the port,
not in the write context. The slot name of the port is renamed
from 'data' to 'recursiveContext' to indicate the role.
Obsoleted Scm_WriteCircular, for it can be handled by either
Scm_Write or Scm_WriteLimited.
2014-01-07 Shiro Kawai <shiro@acm.org>
* src/compile.scm: Bind auxiliary syntactic keywords to a dummy
expander; it'd be easier to work with modules if we have toplevel
bindins instead of leaving them undefined.
2013-12-30 Shiro Kawai <shiro@acm.org>
* lib/gauche/test.scm (closure-grefs): Include PUSH-GREF-CALL
and PUSH-GREF-TAIL-CALL insns to check arity mismatch.
2013-12-24 Shiro Kawai <shiro@acm.org>
* src/compile.scm (import): Show a descriptive error message when
Gauche's import is called as if R7RS import.
2013-12-22 Shiro Kawai <shiro@acm.org>
* src/genconfig.in: Add site-specific directories to --incdirs and
--archdirs options. Some extention libraries (e.g. Gauche-gl)
installs header files and DSOs there, and libraries depending
on them need to see them at compile time.
2013-12-20 Shiro Kawai <shiro@acm.org>
* lib/gauche/dictionary.scm (make-bimap, bimap-put!): Allow bimap
to have the default on-conflict setting.
2013-12-19 Shiro Kawai <shiro@acm.org>
* lib/srfi-106.scm (*ai-v4mapped*): Workaround for the platforms
where AI_V4MAPPED may not be defined even if ipv6 is provided.
2013-12-13 Shiro Kawai <shiro@acm.org>
* src/libnum.scm (sqrt): Improved performance. We did extra sqrt
calculation when the arg was exact but not a square of exact number.
2013-11-27 Shiro Kawai <shiro@acm.org>
* lib/www/cgi.scm (cgi-get-query): Fixed a bug that caused the
procedure not to retrieve the entire POST request body, if
the input port wasn't fully buffered.
2013-11-26 Shiro Kawai <shiro@acm.org>
* libsrc/srfi-13.scm (string-filter, string-delete): We noticed that
we got the argument order of these wrong for long time. The order
is corrected, but to support code written for the old order, we
permit the caller to use the old API as well.
2013-11-24 Shiro Kawai <shiro@acm.org>
* libsrc/text/tr.scm (build-char-array): Fixed a bug that prevented
having '\' in spec.
2013-11-22 Shiro Kawai <shiro@acm.org>
* src/read.c, src/libstr.scm, lib/gauche/interpolate.scm:
Enabled the new string interpolation syntax #"... ~expr ...".
Still needs appropriate check according to the reader mode.
2013-11-19 Shiro Kawai <shiro@acm.org>
* src/libdict.scm (make-hash-table): Experimentally added
optional 'init-size' argument. We might change the API later,
so this is unofficial.
2013-11-13 Shiro Kawai <shiro@acm.org>
* ext/text/unicode.scm (%foldcase): Fixed handling of final sigma---
we need the same treatment as string-downcase.
2013-11-12 Shiro Kawai <shiro@acm.org>
* test/r7rs.scm, test/r7rs-test.scm: Added r7rs test taken from Chibi.
Run r7rs.scm, which is a Gauche wrapper to execute r7rs-test.scm.
Not yet added to TESTS, for we have a few missing features.
2013-11-10 Shiro Kawai <shiro@acm.org>
* src/regexp.c (rex_rec): Fixed submatch capture failure. Patch
from leque.
2013-11-08 Shiro Kawai <shiro@acm.org>
* src/port.c, src/portapi.c (Scm_PortAttrGet etc.): Port attributes.
This is to generalize accessing various information on ports,
and eventually allow ports to abstract broader external
resources (e.g. accessing httpd via ports).
2013-11-07 Shiro Kawai <shiro@acm.org>
* src/char.c (Scm_DigitToInt, Scm_IntToDigit): More generalized
treatment of non-ASCII digit characters. THIS CHANGE BREAKS ABI
COMPATIBILITY. We think it's better to make it clean, hoping
no external modules rely on this API.
* src/libchar.scm (digit->integer, integer->digit): Extended
accordingly. In Scheme level it's backward compatibile.
2013-11-02 Shiro Kawai <shiro@acm.org>
* src/gauche/priv/portP.h: Splitted internal stuff from port.h.
2013-10-31 Shiro Kawai <shiro@acm.org>
* lib/data/random.scm (sequences-of): Added.
2013-10-28 Shiro Kawai <shiro@acm.org>
* src/write.c, src/class.c, src/gauche/priv/writerP.h:
Made ScmWriteContext a Scheme object. Another step towards
rewriting 'write' subsystem.
2013-10-26 Shiro Kawai <shiro@acm.org>
* src/write.c (write_walk), src/libio.scm (%write-walk-rec): A
step towards rewriting 'write' subsystem - rewrote the walk pass
in Scheme.
2013-10-25 Shiro Kawai <shiro@acm.org>
* src/gauche/system.h, src/signal.c: Changed handling of SIGPIPE.
If Gauche is asked to take care of SIGPIPE, we do nothing for
it by default. The program can handle the situation by
capturing EPIPE <system-error> anyway.
* src/gauche/port.h, src/libio.scm, src/port.c, src/portapi.c:
Added an internal flag that can terminate the process if
writing raised EPIPE. By default, only stdout and stderr have the
flag set. This makes casual tools that write to stdout to be piped
together behave the similar way as other Unix commands, while
other use of pipes (e.g. sockets) won't cause annoying termination
via SIGPIPE.
NB: We still need an API to change this flag.
NB: Code that has been accessed ScmBufferedPort.mode needs to be
changed to use the new API Scm_GetPortBufferingMode etc.
(Scm_KeywordToBufferingMode, Scm_GetPortBufferingModeAsKeyword):
More descriptive API name than Scm_BufferingMode and
Scm_GetBufferingMode. The latter will be removed after 1.0 release.
2013-10-20 Shiro Kawai <shiro@acm.org>
* src/regexp.c (rc1_parse, rc3_rec): Fixed a bug handling
(?(condition)yes-pattern). It should take into account of
empty no-pattern, e.g. (?(condition)yes-pattern|), which makes
the pattern always match if condition doesn't hold.
Patch from leque.
* lib/gauche/regexp.scm (regexp-unparse): Ditto.
2013-10-13 Shiro Kawai <shiro@acm.org>
* lib/text/diff.scm (diff): Bug fix: 'Equal' keyword argument was
ignored. Patch from Rui Ueyama.
2013-10-12 Shiro Kawai <shiro@acm.org>
* src/number.c (Scm_PrintNumber, Scm_PrintDouble): Changed to return
# of characters written.
* src/write.c (write_char): Use numeric notation for unprintable
characters. NB: Currently, we print with internal encoding,
which is incompatible to R7RS if Gauche is compiled with euc-jp
or sjis. We eventually need some writer-mode switch.
2013-10-10 Shiro Kawai <shiro@acm.org>
* src/read.c, src/gauche/reader.h, src/gauche/priv/readerP.h:
Moved ScmReadContext implementation delcs into a private header.
Added public API to modify reader lexical compatibility mode.
Use parameter to keep the default read context.
Integrate WARN_LEGACY flag to read context instead of vm runtime flag.
* src/libio.scm: Added parameter-like procedure read-lexical-mode
and supported #!gauche-legacy and #!r7rs switch.
2013-10-09 Shiro Kawai <shiro@acm.org>
* lib/gauche/priv/*.h: Moved some private header files into separate
directory. builtin-syms.h is now private---the index changes between
versions, so external binaries shouldn't rely on that.
We'll go through other header files and split private parts into
priv/*P.h.
2013-10-06 Shiro Kawai <shiro@acm.org>
* lib/gauche/sortutil.scm, lib/gauche/generic-sortutil.scm:
Adapted to SRFI-95, and also handles generic <sequence>.
2013-10-04 Shiro Kawai <shiro@acm.org>
* lib/gauche/configure.scm: Added support for directory stuff
(srcdir etc.), and added tests.
2013-09-28 Shiro Kawai <shiro@acm.org>
* src/read.c: Issue warning when we see legacy \xNN hex-digit escape,
if SCM_READER_WARN_LEGACY runtime flag is set. We'll also use
this flag for some other planned syntax changes (e.g. string
interpolation syntax).
* src/main.c: Added -fwarn-legacy-syntax option that turns on the
SCM_READER_WARN_LEGACY flag. For the time being we treat it
unofficial, let's see how useful it is.
2013-09-25 Shiro Kawai <shiro@acm.org>
* src/module.c (search_binding): Fixed a bug in transitive export; the
bug prevented the 'only' modifier work on transitively exported
symbols.
* src/compile.scm (pass1/body-rec): Support internal syntax definitions.
2013-09-24 Shiro Kawai <shiro@acm.org>
* src/gauche/exception.h, src/error.c: Changed the role of 'message'
slot in ScmMessageCondition, to enable R7RS error-object-message
and error-object-irritants with keeping ABI compatibility.
Scheme-level interface is compatibile, but C code accessing
message field directly would get something a bit different from
what it got in previous versions. Those code should use
Scm_ConditionMessage() API instead of direct field access.
2013-09-23 Shiro Kawai <shiro@acm.org>
* src/libsys.scm (sys-errno->symbol, sys-symbol->errno): Mapping
between integer error numbers and their symbolic names.
2013-09-22 Shiro Kawai <shiro@acm.org>
* src/read.c (Scm_ReadXdigitsFromString, Scm_ReadXdigitsFromPort):
Rewritten to handle \x, \u and \U hex-digit escapes consistently,
with the support of bothnew R7RS-style syntax and legacy syntax.
They used to be in char.c, but moved to read.c. The API has been
changed (INCOMPATIBLE CHANGE).
2013-09-18 Shiro Kawai <shiro@acm.org>
* src/read.c (read_string), src/string.c (string_putc): Switched to
R7RS compatible hex-escape syntax (\xNNN;). Reading the legacy
syntax (without ';' terminator) is supported by default, as far as
the input can't be interpreted as R7RS syntax.
For output, currently we only support R7RS style. Might add
compatibility mode if needed.
* src/string.c (Scm_DStringPeek): Added. Useful to avoid allocation
when we use dstr just as a temporary variable-sized buffer.
2013-09-17 Shiro Kawai <shiro@acm.org>
* src/gen-unicode.scm: Added code generator for unicode numeric value
attribute.
* src/char_attr.c: Regenerated.
* src/char.c (Scm_DigitToInt): Handles all Nd characters.
2013-09-16 Shiro Kawai <shiro@acm.org>
* lib/gauche/dictionary.scm (dict->alist): Provide fallback methods
using dict-fold.
(<stacked-map>): Added stacked map experimentally.
2013-09-12 Shiro Kawai <shiro@acm.org>
* lib/gauche/numerical.scm (real->rational): Fixed a bug in refine/c
that doesn't find simplest rational when two continued fraction has
(x0 ... xn xn+1 ...) and (y0 ... yn), where xi = yi (0 <= i <= n-1)
and |xn - yn| > 1. Original code just picked the shorter series,
but picking min(xn + 1, yn) makes the result simpler.
2013-09-11 Shiro Kawai <shiro@acm.org>
* src/libstr.scm (string=? etc): Support more than two arguments.
* ext/text/unicode.scm (string-ci=? etc): Provide R7RS compatible
full-string case folded comparison.
* lib/r7rs.scm (string-ci=? etc): Use text.unicode version instead of
built-in version.
2013-09-10 Shiro Kawai <shiro@acm.org>
* lib/gauche/defvalues.scm (define-values): Support <formals> in
the variable list position, as specified in r7rs. Also make it
possible to use define-values mixed in internal defines.
* src/macro.c (match_synrule): Supports trailing items after ellipsis,
according to r7rs (e.g. (a b ... c) etc.)
2013-09-08 Shiro Kawai <shiro@acm.org>
* lib/rfc/http.scm (http-request): Fixed broken behavior of redirect
handling. The body of 3xx request shouldn't be retrieved with
caller-supplied receiver.
2013-09-02 Shiro Kawai <shiro@acm.org>
* src/macro.c (Scm_CompileSyntaxRules),
src/compile.scm (pass1/syntax-rules): Support alternative ellipsis
as in R7RS.
2013-09-01 Shiro Kawai <shiro@acm.org>
* src/compile.scm (define-builtin-inliner-/, pass2/const-numop1)
(pass2/const-numop2): Avoid constant-folding for exact div-by-zero
case. We should leave it to be handled at runtime.
2013-08-26 Shiro Kawai <shiro@acm.org>
* lib/www/cgi.scm (cgi-parse-parameters): Fixed a bug when multiple
values with the same parameter name are passed via
multipart/form-data.
* lib/rfc/uri.scm (uri-compose-data, uri-decompose-data): Added
'data:' uri scheme support.
2013-08-22 Shiro Kawai <shiro@acm.org>
* lib/rfc/uri.scm (uri-encode): Use uppercase for percent-encoding
of special chars, as recommended in RFC3986.
2013-08-20 Shiro Kawai <shiro@acm.org>
* lib/srfi-106.scm, doc/modsrfi.texi: Changed according to final
spec, and documented.
2013-08-19 Shiro Kawai <shiro@acm.org>
* lib/data/random.scm: Fixed some bugs.
* doc/modutil.texi: Document data.random. Now it's official.
2013-08-16 Shiro Kawai <shiro@acm.org>
* src/vm.c, src/vminsn.c: Some runtime optimizations to improve
tight-loop routines (sequence of vm instruction loops that doesn't
call extra functions much). We reduced the check of attentionRequest,
and detect value-yielding insn followed by PUSH. See the comment
near NEXT_PUSHCHECK in vm.c for the details.
2013-08-14 Shiro Kawai <shiro@acm.org>
* src/libnum.scm (expt): Try to return an exact result when the power
is exact rational and result can be exact.
E.g. (expt 8/125 2/3) => 4/25.
2013-08-13 Shiro Kawai <shiro@acm.org>
* lib/gauche/configure.scm: Added. Not completed yet.
2013-08-11 Shiro Kawai <shiro@acm.org>
* ext/uvector/uvutil.scm (u8vector-append etc): Added.
2013-08-10 Shiro Kawai <shiro@acm.org>
* src/module.c (Scm_FindBinding): Support transitive export, i.e.
allow exporting symbols that are imported or inherited, without
explicitly defining it in the module.
* libsrc/srfi-1.scm, libsrc/srfi-13.scm, lib/srfi-14.scm, lib/srfi-60.scm
Changed accordingly.
2013-08-08 Shiro Kawai <shiro@acm.org>
* lib/file/filter.scm (file-filter): Fixed a bug that the outputfile
is not created when :temporary-file #t :leave-unchanged #t.
* libsrc/text/tr.scm (complement-char-array): Fixed a bug that
made complement yield incorrect set when from-str isn't in
increasing order of character codes.
2013-08-05 Shiro Kawai <shiro@acm.org>
* lib/gauche/libutil.scm (library-has-module?): Quick fix to recognize
R7RS define-library form as well. The 'library' clause of cond-expand
relies on this procedure (via library-exists?) so it's critical to
handle R7RS here.
2013-08-03 Shiro Kawai <shiro@acm.org>
* src/module.c, src/libmod.scm: Updated the list of builtin modules.
* ext/srfi/generate-srfi.scm: Autogenerate srfi/N.scm for supported
srfi-N to make (import (srfi N)) work in r7rs mode.
2013-08-02 Shiro Kawai <shiro@acm.org>
* lib/srfi-106.scm: Added. Since srfi-106 is still a draft, the API
may be changed according to its final version.
2013-08-01 Shiro Kawai <shiro@acm.org>
* src/core.c: Defined some feature identifiers specified in R7RS
Appendix B. (Not exhaustive yet).
2013-07-30 Shiro Kawai <shiro@acm.org>
* src/main.c, lib/r7rs.scm: In R7RS toplevel mode, set the default
environment to #<module r7rs.user> instead of #<module user>.
Keeping #<module user> able to operate in Gauche mode is convenient
to evaluate .gaucherc in #<module user> regardless of whether Gauche
is invoked in -r7 or not.
We also define a variable *r7rs-mode* in #<module user> if invoked
with -r7, so that gauche.interactive can do extra set up if necessary.
* lib/gauche/interactive.scm: Modified accordingly.
2013-07-28 Shiro Kawai <shiro@acm.org>
* src/vm.c (throw_continuation): Fixed a bug that failed to save
living continuations on stack when a ghost continuation is invoked,
which caused the conitnuation frames to be clobbered.
See the comment for the details.
2013-07-26 Shiro Kawai <shiro@acm.org>
* src/number.c (Scm_SinPi, Scm_CosPi, Scm_TanPi): EXPERIMENTAL:
Added sinpi(x) = sin(x*pi) etc. to allow avoiding errors in
certain cases. From Scheme they're %sinpi etc. Not yet documented.
See if they're worth having.
* src/number.c (scm_expt): Use Scm_SinPi etc. so that
(expt <negative-integer> n+1/2) can return pure imaginary number.
2013-07-18 Shiro Kawai <shiro@acm.org>
* lib/rfc/base64.scm (base64-decode, base64-encode): Support url-safe
keyword argument to encode/decode url-safe version of characters.
Patch from Rui Ueyama.
2013-07-14 Shiro Kawai <shiro@acm.org>
* src/read.c: Support R7RS-style inline hex escape in symbol literals.
* src/char.c: Changed Scm_ReadXdigitsFromPort to recognize delimiter
of inline-hex escape. NB: Technically this changes ABI, but
the function isn't intended for public use and I doubt it's
used by extension packages.
2013-07-06 Shiro Kawai <shiro@acm.org>
* src/gauche-init.scm: Retire gauche-init.scm. We can already
precompile Scheme initialization routine, so we no longer need to
keep it. And it is inconvenient for embedding use.
Various files are modified to remove reference to gauche-init.scm.
* src/genconfig.in, src/paths.c, src/Makefile.in: No longer generate
gauche/arch.h; having architecture-dependent header file is just
an annoyance. Besides we don't really need to make the info in the
header file since those info can be retrieved through API at
runtime. This change removes preprocessor symbols GAUCHE_ARCH,
GAUCHE_LIB_DIR, GAUCHE_ARCH_DIR, GAUCHE_SITE_LIB_DIR and
GAUCHE_SITE_ARCH_DIR.
2013-07-05 Shiro Kawai <shiro@acm.org>
* ext/tls: Updated to axTLS 1.4.9
2013-07-04 Shiro Kawai <shiro@acm.org>
* src/compile.scm: Support letrec*.
2013-07-03 Shiro Kawai <shiro@acm.org>
* lib/gauche/common-macros.scm (dotimes, dolist): Support omission
of 'variable'.
2013-07-02 Shiro Kawai <shiro@acm.org>
* src/libnum.scm (%log): Handle input even if it can't fit in
IEEE double e.g. (log (expt 2 2048)) => 616.5094311198334
2013-06-30 Shiro Kawai <shiro@acm.org>
* lib/gauche/cgen/stub.scm (define-cptr): Experimentally added
stub form to declare a foreign pointer class using ScmForeignPointer.
2013-06-28 Shiro Kawai <shiro@acm.org>
* lib/gauche/vecutil.scm: Added. Supports R7RS vector-map and
vector-for-each. Also includes vector-tabulate.
* src/autoloads.scm: Autoload gauche.vecutil.
* lib/r7rs.scm: Changed accordingly.
* ext/srfi/srfi-43.scm: Define vector-map etc. as an alias of
vector-map-with-index etc.
2013-06-26 Shiro Kawai <shiro@acm.org>
* ext/text/unicode.scm (utf8->string, string->utf8): Added these
r7rs procedures here.
* lib/r7rs.scm: Use above procedures.
2013-06-25 Shiro Kawai <shiro@acm.org>
* ext/dbm/dbm.ac: Added --with-dbm=DBM,... configure option, to
exclude some dbm libraries that would be compiled by default.
2013-06-22 Shiro Kawai <shiro@acm.org>
* src/compile.scm (pass2/intermediate-lref-removal): Fixed a bug
that does incorrect transformation under existence of side-effects.
2013-06-19 Shiro Kawai <shiro@acm.org>
* lib/srfi-0.scm (cond-expand): Support R7RS 'library' feature test.
* lib/r7rs.scm, lib/gauche/libutil.scm: Moded library-name->module-name
from r7rs to gauche.libutil, for it is needed by srfi-0.
2013-06-15 Shiro Kawai <shiro@acm.org>
* src/compile.scm (pass1/open-include-file): Searches also
*load-path* for specified file. We now use find-load-file,
so the load-path-hook stuff can also work.
* src/liblist.scm, libsrc/srfi-1.scm (concatenate, concatenate!,
append-reverse, append-reverse!, append-map, append-map!):
Further migration of srfi-1 procedures into core.
* lib/gauche/parseopt.scm: Removed dependency on srfi-1.
2013-06-14 Shiro Kawai <shiro@acm.org>
* src/liblist.scm, libsrc/srfi-1.scm (count, reduce, reduce-right,
partition): Move from srfi-1.scm to liblist.scm, so that
gauche.procedure won't depend on srfi-1.
* lib/gauche/procedure.scm: Removed dependency on srfi-1.
2013-06-12 Shiro Kawai <shiro@acm.org>
* src/compile.scm, src/libobj.scm, src/autoloads.scm,
lib/gauche/procedure.scm, lib/gauche/experimental/app.scm,
lib/gauche/cgen/precomp.scm: Flushed suspended changes and temporary
kludges to build 0.9.3 gauche by pre-0.9.2 gauche.
2013-06-10 Shiro Kawai <shiro@acm.org>
* src/code.scm, src/libcode.scm (compiled-code-copy!): Added.
* lib/gauche/cgen/precomp.scm, lib/gauche/cgen/optimizer.scm:
Experimentally added extra optimization at precompile time
(it's off by default now).
2013-06-09 Shiro Kawai <shiro@acm.org>
* lib/gauche/vm/insn-core.scm (vm-insn-size): Added.
* ext/util/queue.scm (%mtqueue-overflow?): Bug fix from @tabe via
pullreq. It didn't return boolean value properly.
2013-06-07 Shiro Kawai <shiro@acm.org>
* src/libcode.scm, src/compile.scm: Splitted VM code generation API
into gauche.vm.code module.
* lib/gauche/cgen/precomp.scm (compile-toplevel-form): Execute export
operation during initialization when the compilation does not
produce *.sci file.
2013-06-05 Shiro Kawai <shiro@acm.org>
* src/compile.scm (pass5/if-final): Micro-optimization to eliminate
one JUMP instruction in certain cases.
* src/libio.scm (eof-object): Mark it :constant, so that the calls
would be inlined.
2013-06-01 Shiro Kawai <shiro@acm.org>
* src/regexp.c (rc1_parse): Fixed a bug in backreference to the nested
group case (see the added tests for the details).
2013-05-31 Shiro Kawai <shiro@acm.org>
* ext/Makefile.in: Reordered SUBDIRS: uvector must be built before
threads, since gauche.records used by threads now depends on uvector.
* Makefile.in, ext/Makefile.in: Exits abnormally if any of submake
inside for loop fails.
* lib/text/csv.scm (make-csv-reader): Rewrote in straightforward way.
It turned out the naive "read one char at a time, accumulate into a
list, and list->string to make a field" approach is 5x faster than
the previous string-scanning code. Also the port argument for
the returned reader is now optional.
2013-05-30 Shiro Kawai <shiro@acm.org>
* lib/gauche/cgen/precomp.scm (compile-toplevel-form): Avoid emitting
the toplevel pattern CLOSURE - DEFINE - RET generated by toplevel
definitions. Instead we call Scm_MakeBind at initialization.
This reduces code vector size slightly.
2013-05-25 Shiro Kawai <shiro@acm.org>
* various files: Removed unnecessary "use"-dependencies, and put
less-frequently used features into autoloads, in order to speed
up initial startup, especially for www.cgi.
libsrc/gauche/parameter.scm - autoload hook features
lib/rfc/mime.scm - splitted parts that needs gauche.vport
lib/gauche/portutil.scm, src/libio.scm - move port-tell and
port-position-prefix from portutil to libio.
2013-05-24 Shiro Kawai <shiro@acm.org>
* lib/gauche/logical.scm (copy-bit-field): Fixed the argument order
to comply SRFI-60. THIS IS AN INCOMPATIBLE CHANGE. A note is
added to the manual entry about it.
2013-05-22 Shiro Kawai <shiro@acm.org>
* src/libeval.scm (find-load-file): Experimentally allow to trigger
load hooks by "" in the PATHs list. Convenient to be used when
Scheme sources are embedded in the executing binary.
2013-05-21 Shiro Kawai <shiro@acm.org>
* lib/gauche/cgen/literal.scm (c-safe-string-literal): replace '?'
in the string as well. A cheap workaround to avoid putting trigraph
in C string literal inadvertently.
2013-05-20 Shiro Kawai <shiro@acm.org>
* lib/gauche/record.scm: Export <pseudo-record>.
2013-05-18 Shiro Kawai <shiro@acm.org>
* lib/gauche/interactive.scm: Let #<module gauche> export history
variable, so that it can be imported to the r7rs REPL for the
convenience.
2013-05-17 Shiro Kawai <shiro@acm.org>
* lib/gauche/record.scm: Support pseudo records for <list> and
uniform vectors. Support rtd-predicate for pseudo records.
2013-05-16 Shiro Kawai <shiro@acm.org>
* src/load.c (Scm_RegisterPrelinked, Scm_DynLoad): Experimentally
added support for statically linking extensions.
* src/Makefile.in, ext/*/Makefile.in, src/gen-staticinit.scm:
Changes to support creating static linking version of libgauche.
2013-05-15 Shiro Kawai <shiro@acm.org>
* lib/gauche/procedure.scm (generator-find): Added.
* lib/gauche/generator.scm (gbuffer-filter): Added.
* lib/rfc/http.scm (%http-request-adaptor): If the caller gives :sink
or :flusher, we mandate both should be given. Giving just either
one should be rare case (and it's not likely to be working in the
current version---suppose you pass a file port to sink but not
giving flusher; then the current code raises an error, since the
adaptor provides the default flusher that calls get-output-string
on the sink.) It is better to mandate both, so that we can catch
caller's misspelling of :sink or :flusher.
2013-05-11 Shiro Kawai <shiro@acm.org>
* ext/net/net.c: Plugged resource (fd) leak on Windows. We need to
close fds opened by _open_osfhandle, but the trick is that we only
can do it at the time when the socket is closed.
* src/number.c (Scm_FloatSign, print_double, scm_div): Basic support
for negative inexact zero. We actually have the representation of
-0.0 internally, but didn't have printer honor it. Most calculations
just works because libc does the job. However, we need to
distinguish positive-zero imaginary part and negative-zero imaginary
part, which requires some surgery since we implicitly coerce complex
numbers with zero imaginary part to real numbers.
* src/libnum.scm (%log): Likewise. (log 0.0) ==> -inf.0 but
(log -0.0) ==> -inf.0+3.141592653589793i.
2013-05-10 Shiro Kawai <shiro@acm.org>
* lib/gauche/interactive.scm: Imports R7RS-small standard libraries
when gosh is invoked in interactive r7rs mode, so that they are
available in REPL.
2013-05-06 Shiro Kawai <shiro@acm.org>
* src/read.c (read_sharp_word): Support #true and #false. This
also changes how the #-word is delimited: #t and #f used to delimit
themselves (except #f8, #f16 and #f32), but now we read a word
then match the token. So, #f.1 used to be read as #f and 0.1,
but now it raises an error saying "invalid #-token: #f.1".
I don't think this causes a problem in existing code, but there
may be a datafile that relies on the old behavor; we'll watch.
Note that this isn't fully R7RS compatible yet. The way R7RS
delimits tokens is different (e.g. we read "#false#false" as two
boolean falses, but iiuc, R7RS reader should read it as one token
and raise an error of invalid token.)
This also changes how the tokens with hash signs are read;
".#" used to be read as a symbol, but now it is an error.
See the comment in 'Symbols and Numbers' section of the code.
Again, I doubt it causes any problem in existing code; and I worry
less about datafiles, since when such weird symbols are written,
it is |-escaped, so it can read back with the current reader.
2013-05-05 Shiro Kawai <shiro@acm.org>
* src/libsym.scm (symbol=?): Added for R7RS.
* src/libbool.scm (boolean=?): Added for R7RS.
* src/liblist.scm (list-set!): Make it built-in.
* libsrc/file/util.scm (delete-file, remove-file): Added for R7RS
compatibility.
* lib/r7rs.scm (delete-file): Changed accordingly.
2013-05-04 Shiro Kawai <shiro@acm.org>
* src/gauche/writer.h: Splitted writer related decls.
* src/main.c (main): Experimentally support -r7 option to start up
gosh with R7RS environment as default. Currently this is mainly
for the convenience of developing R7RS compatibility code.
* lib/gauche/numerical.scm (floor/ etc.): Added R7RS integer division
operators.
(square): ditto.
* autoloads.scm: Changed accordingly.
* lib/r7rs.scm (define-library): Support R7RS define-library.
* autoloads.scm (define-library): Autoload define-library so that
Gauche native code can use R7RS library seamlessly.
2013-05-03 Shiro Kawai <shiro@acm.org>
* src/libmod.scm, src/module.c (module-name->path, path->module-name):
Moved definition of these two from C to Scheme, and supports
module name components to have dot in it. It won't so much useful
from Gauche, but R7RS library name may have (foo.bar baz) and
we need to map it to Gauche's module name.
* lib/r7rs.scm, lib/scheme/base.scm: Start adding R7RS compatibility
stuff.
* src/load.c (Scm_Require): Make sure we set the current module
to #<module gauche> when actually loading the file. This was
never explicitly stated, but we always assumed so. It doesn't
make sense to use caller's current module, since the caller
doesn't know if the file will actually be loaded or not, so
there's no guarantee that the current module is in effect.
This change might cause an incompatibility in the code that
took advantage of the old require behavior, but I doubt such
code exists.
(Scm_ResolveAutoload): The exception of above 'require' spec
is autoloading; we do need to load the file into a specific
module.
2013-05-01 Shiro Kawai <shiro@acm.org>
* src/libsys.scm: Feature identifiers gauche.sys.setenv,
gauche.sys.unsetenv, gauche.sys.clearenv, gauche.sys.sigwait,
and gauche.sysgetloadavg weren't defined properly.
2013-04-28 Shiro Kawai <shiro@acm.org>
* src/liblist.scm (take-right*): When the list is long and k is
small, try not to keep entire list on memory - would help when
taking the last k elements of a lazy sequence. Not an ideal
solution, but would work for the time being.
2013-04-27 shiro <shiro@acm.org>
* src/liblist.scm (length<=?): Added.
2013-04-25 Shiro Kawai <shiro@acm.org>
* src/module.c (Scm_ExportSymbols): Fixed a bug that searched
external table with internal name (patch from enami).
Also added a check to see if 'export' overrides the previous exports.
2013-04-24 Shiro Kawai <shiro@acm.org>
* ext/sparse/sparse.scm: Added generalized setter to
sparse-table-ref and sparse-vector-ref.
2013-04-23 Shiro Kawai <shiro@acm.org>
* src/gauche/module.h (ScmModule), src/gauche/gloc.h (ScmGloc),
src/module.c, src/gloc.c: Changed the way exported bindings
are handled. Instead of having a flag in GLOC, we now have
to hashtables in ScmModule, one for internal (all) bindings and
another for exported bindings. This allows us to implement
export-time renaming easily.
This changes the struct layout of ScmModule and ScmGloc, and
IT MIGHT BREAK ABI COMPATIBILITY, although both of those structs
are always allocated at runtime and accessed via API from
outside of libgauche, I expect it won't affect much.
The 'exported' list in ScmModule is dropped; if you want a
list of exported symbols, call Scm_ModuleExports() to calculate
the list.
NB: Scm_ExportSymbols no longer returns a list of exported symbols.
* src/module.c (Scm_ExportSymbols): Allow export-time renaming,
as specified in R[67]RS.
2013-04-21 Shiro Kawai <shiro@acm.org>
* src/compile.scm: Added include-ci support, and allows multiple
files with include/include-ci, as R7RS.
* doc/coresyn.texi: Added docs for include and include-ci.
2013-04-19 Shiro Kawai <shiro@acm.org>
* src/libobj.scm (object-apply): Made char-set applicable.
2013-04-18 Shiro Kawai <shiro@acm.org>
* lib/dbm.scm (call-with-iterator, coerce-to): Added missing
collection framework support to dbm.
2013-04-17 Shiro Kawai <shiro@acm.org>
* src/libeval.scm (command-line): Added R7RS-ish command-line access
procedure. This is better than old *program-name*/*argv* variables.
* src/core.c (Scm_InitCommandLine): A convenience C API to initialize
command-line, *program-name* and *argv* from C code.
* src/main.c: Changed to use Scm_InitCommandLine.
* lib/gauche/logger.scm: Changed accordingly.