Skip to content

Commit

Permalink
Version 7.9.2 := operator
Browse files Browse the repository at this point in the history
  • Loading branch information
damien-mattei committed Apr 2, 2024
1 parent 8b0a470 commit 5ff4eab
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 9 deletions.
4 changes: 2 additions & 2 deletions main.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@
for-basic
for-basic/break
reversed
<- ←
<- ← :=
-> ;; can conflict with typed racket
;; can conflict with typed racket
<+ ⥆
<+ ⥆ :+
+> ⥅
declare
$>
Expand Down
24 changes: 19 additions & 5 deletions src/SRFI-105.scm
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,14 @@
((or (eq? c #\)) (eq? c #\]) (eq? c #\}))
(read-char port)
(read-error "Bad closing character"))
(#t

(#t

(let ((datum (my-read port)))
(cond

(cond

;; 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
Expand All @@ -121,9 +126,18 @@
(#t
(read-char port)
datum2))))
(#t
(cons datum
(my-read-delimited-list my-read stop-char port)))))))))

(#t
;; here we get a symbolic scheme expression
(let ((datum2 (cons datum
(my-read-delimited-list my-read stop-char port))))

;; (when (and (list? datum2)
;; (not (null? datum2))
;; (equal? (car datum2) 'if))
;; (error "find an IF in datum2:" datum2))

datum2))))))))



Expand Down
8 changes: 8 additions & 0 deletions src/assignment.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,14 @@



(define-syntax :=

(syntax-rules ()

((_ var ...) (<- var ...))))



;; (declare x y z)
;; {(x y z) <v (values 2 4 5)}
;; > (list x y z)
Expand Down
8 changes: 8 additions & 0 deletions src/def.scm
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,14 @@
((_ var ...) (<+ var ...))))



(define-syntax :+
(syntax-rules ()

((_ var ...) (<+ var ...))))



;; > {(values 2 4 5) +> (x y z) +> (u v w) +> (a b c)}
;; 2
;; 4
Expand Down
4 changes: 2 additions & 2 deletions src/operation-redux.scm
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

;;(list 'dummy) ;; can keep the good order in case of non left-right assocciative operators.(odd? reverse them)

(<- -> ← → <v v> ⇜ ⇝)
(<+ +> ⥆ ⥅)
(<- -> ← → := <v v> ⇜ ⇝)
(<+ +> ⥆ ⥅ :+)
)

)
Expand Down

0 comments on commit 5ff4eab

Please sign in to comment.