Skip to content

Commit

Permalink
Version 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
damien-mattei committed Apr 9, 2024
1 parent ba0859b commit 9c523b1
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 20 deletions.
18 changes: 15 additions & 3 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
new macro if then else
optimize what can be easily optimized : example <+ define
try to support a R6RS version (fork/branch on github)
tester le parsing avec make Makefile


> (define-syntax (defined? stx)
(syntax-case stx ()
[(_ id)
(with-syntax ([v (identifier-binding #'id)])
#''v)]))
> (defined? zz)
#f
> (defined? x)
'(#<module-path-index="/Users/mattei/Scheme-PLUS-for-Racket/main/Scheme-PLUS-for-Racket/src/REPL-Scheme-PLUS.rkt">
x
#<module-path-index="/Users/mattei/Scheme-PLUS-for-Racket/main/Scheme-PLUS-for-Racket/src/REPL-Scheme-PLUS.rkt">
x
0
0
0)
2 changes: 1 addition & 1 deletion info.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"sci"
"r6rs-lib"))
(define pkg-desc "Scheme+ for Racket and SRFI-105 curly-infix with REPL")
(define version "7.5")
(define version "8.1")
(define pkg-authors '(mattei))
(define scribblings '(("scribblings/scheme-plus.scrbl" ())))
(define build-deps '("scribble-lib" "racket-doc" "scribble-code-examples" "scribble-doc"))
Expand Down
2 changes: 1 addition & 1 deletion main.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

;; main.rkt (old name: Scheme+.rkt)

;; version 8.1
;; version 8.2

;; author: Damien MATTEI

Expand Down
4 changes: 1 addition & 3 deletions src/SRFI-105.scm
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,7 @@

;; here we got chars ... (not symbols)
;; processing period . is important for functions with variable numbers of parameters: (fct arg1 . restargs)
((eq? datum (string->symbol (string #\.))) ;; only this one works with Racket Scheme
;;((eq? datum '.) ;; do not works with Racket Scheme
;;((eq? datum 'period) ;; this one annihilate the processing: datum will never be equal to 'period !
((eq? datum (string->symbol (string #\.))) ;; only this one works
(let ((datum2 (my-read port)))
(consume-whitespace port)
(cond
Expand Down
22 changes: 12 additions & 10 deletions src/assignment.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,20 @@
;; "ab0d0f0h"

;; $bracket-apply$ is from SRFI 105 bracket-apply is an argument of the macro

(define-syntax <-

(syntax-rules ()

(lambda (stx)

(syntax-case stx ()

;; {(x y) <- Lexemples[ip]}
((_ (kar kdr) expr) ; expr must be a pair

(begin
;;(display "<- : case (_ (kar kdr) expr)") (newline)
(set! kar (car expr))
(set! kdr (cdr expr))))
#`(begin
;;(display "<- : case (_ (kar kdr) expr)") (newline)
(set! kar (car expr))
(set! kdr (cdr expr))))



Expand All @@ -94,7 +96,7 @@
;;((_ (brket-applynext container (lst index index1 ...)) expr)
((_ (brket-applynext container (lst index ...)) expr) ;; possible to have NO index

(begin
#`(begin

;; add a checking
;; (define x 3)
Expand Down Expand Up @@ -147,7 +149,7 @@
;; (display "<- : variable set!") (newline)
;; (display "var =") (display var) (newline)
;; (display "expr =") (display expr) (newline)
(set! var expr))
#`(set! var expr))
;; (display "after set! : var =") (display var) (newline)))
;;var))

Expand All @@ -174,13 +176,13 @@

;;(<- var (<- var1 ... expr)))

(begin ;; i do not do what the syntax says (assignation not in the good order) but it gives the same result
#`(begin ;; i do not do what the syntax says (assignation not in the good order) but it gives the same result
;;(display "<- : case (_ var var1 ... expr)") (newline)
(<- var expr)
(<- var1 var)
...))

))
)))



Expand Down
4 changes: 2 additions & 2 deletions src/curly-infix2prefix4racket.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@

(define stderr (current-error-port))

(include "condx.scm")

(include "SRFI-105.scm")

(define srfi-105 #f)

;;(define lang-reader #f)

(define flag-r6rs #f)

(define (skip-comments-and-empty-lines in)
Expand Down

0 comments on commit 9c523b1

Please sign in to comment.