Skip to content

Commit c2dba95

Browse files
committed
versions 11.7
1 parent 49973d8 commit c2dba95

File tree

6 files changed

+140
-18
lines changed

6 files changed

+140
-18
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,20 @@ Another method is to use the [Makefile](https://github.com/damien-mattei/Scheme-
2828
<br>
2929

3030

31+
32+
33+
**Changes of version 11.7:**
34+
35+
Removed debug info display that should have been commented before releasing the previous version.
36+
Some new doc will be commited, but it should not be as it is work in progress.
37+
38+
<br>
39+
3140
**Changes of version 11.5:**
3241

3342
Correct a bug introduced in v11.3: in ```def+``` source code it is no more ```$nfx$``` that should be used but instead ```$nfx$-rec```.
3443
Rationale: ```def+``` allows both infix and prefix expression in normal parenthesis ( ) by autodetection and this feature is mainly done by ```$nfx$-rec```, at contrary ```$nfx$``` is now generally preferred for expressions that should be only infix,for example the ones in curly parenthesis { }.
3544

36-
<br>
3745

3846
**Changes of version 11.4:**
3947

examples/racket/exo_retropropagationNhidden_layers_matrix_v3_by_vectors+.rkt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
#lang reader SRFI-105
1+
#reader SRFI-105
2+
3+
;;#lang reader SRFI-105
24

35
;; SRFI-105 Curly-infix-expressions and a few more
46

infix-with-precedence-to-prefix.rkt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -613,22 +613,22 @@
613613

614614
;; Welcome to DrRacket, version 8.13 [cs].
615615
;; Language: r6rs, with debugging; memory limit: 8192 MB.
616-
;; > (!*prec-generic-infix-parser '(x <- 10.0 - 3.0 - 4.0 + 1 - 5.0 * 2.0 ** 3.0 / 7.0 ** 3.0) infix-operators-lst-for-parser (lambda (op a b) (list op a b)))
616+
;; (!*prec-generic-infix-parser '(x <- 10.0 - 3.0 - 4.0 + 1 - 5.0 * 2.0 ** 3.0 / 7.0 ** 3.0) infix-operators-lst-for-parser (lambda (op a b) (list op a b)))
617617
;; ((<- x (- (+ (- (- 10.0 3.0) 4.0) 1) (/ (* 5.0 (** 2.0 3.0)) (** 7.0 3.0)))))
618-
;; > (- (+ (- (- 10.0 3.0) 4.0) 1) (/ (* 5.0 (** 2.0 3.0)) (** 7.0 3.0)))
619-
;; > (define ** expt)
620-
;; > (- (+ (- (- 10.0 3.0) 4.0) 1) (/ (* 5.0 (** 2.0 3.0)) (** 7.0 3.0)))
618+
;; (- (+ (- (- 10.0 3.0) 4.0) 1) (/ (* 5.0 (** 2.0 3.0)) (** 7.0 3.0)))
619+
;; (define ** expt)
620+
;; (- (+ (- (- 10.0 3.0) 4.0) 1) (/ (* 5.0 (** 2.0 3.0)) (** 7.0 3.0)))
621621
;; 3.883381924198251
622622

623623
;; Python:
624624
;; 10.0 - 3.0 - 4.0 + 1 - 5.0 * 2.0 ** 3.0 / 7.0 ** 3.0
625625
;; 3.883381924198251
626626

627627

628-
;; > (!*prec-generic-infix-parser '(a ** b ** c) infix-operators-lst-for-parser (lambda (op a b) (list op a b)))
628+
;; (!*prec-generic-infix-parser '(a ** b ** c) infix-operators-lst-for-parser (lambda (op a b) (list op a b)))
629629
;; ((** a (** b c)))
630630

631-
;; > (!*prec-generic-infix-parser '(a - b - c) infix-operators-lst-for-parser (lambda (op a b) (list op a b)))
631+
;; (!*prec-generic-infix-parser '(a - b - c) infix-operators-lst-for-parser (lambda (op a b) (list op a b)))
632632
;; ((- (- a b) c))
633633

634634

@@ -654,7 +654,7 @@
654654
;; $nfx$ : parsed-args=.#<syntax (- (+ (* 3 5) (* 2 (sin 0.5))...>
655655
;; -4.041148922791594
656656

657-
;; > {(3 + 1) * (2 * (2 + 1) - 1) + (2 * 5 - 5)}
657+
;; {(3 + 1) * (2 * (2 + 1) - 1) + (2 * 5 - 5)}
658658

659659

660660
;; ($nfx$ (3 + 1) * (2 * (2 + 1) - 1) + (2 * 5 - 5))
@@ -675,7 +675,7 @@
675675

676676

677677

678-
;; > x
678+
;; x
679679
;; x
680680
;; 3
681681

@@ -700,7 +700,7 @@
700700
;; {2 ¹⁰}
701701
;; 1024
702702

703-
;; > {5 - - 2}
703+
;; {5 - - 2}
704704

705705

706706
;; ($nfx$ 5 - - 2)

info.rkt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
;"SRFI-105-for-Racket"
1212
"try-catch"))
1313
(define pkg-desc "Scheme+ for Racket")
14-
(define version "11.5")
14+
(define version "11.7")
1515
(define pkg-authors '(mattei))
1616
(define scribblings '(("scribblings/scheme-plus.scrbl" ())))
1717
(define build-deps '("scribble-lib" "racket-doc" "scribble-code-examples" "scribble-doc"))

parse-square-brackets.rkt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
(if (infix? #;infix-simple? partial-result) ; we test but we do not need to check all the syntax
6767

6868
($> ; then
69-
(display "psba 1 : infix detected ") (newline)
69+
;;(display "psba 1 : infix detected ") (newline)
7070

7171
(insert-tail-set! #;append-tail-set! result (!*prec-generic-infix-parser partial-result
7272
creator
@@ -102,14 +102,14 @@
102102
(when (not (null? partial-result)) ;; check infix expression exist really
103103
;;(display "not null") (newline)
104104

105-
(display "psba : result =") (display result) (newline)
106-
(display "psba 2 : partial-result =") (display partial-result) (newline)
105+
;;(display "psba : result =") (display result) (newline)
106+
;;(display "psba 2 : partial-result =") (display partial-result) (newline)
107107

108108
;; check it is in infix, not already prefixed (we are in scheme...) we test but we do not need to check all the syntax
109109
(if (infix? #;infix-simple? partial-result) ;; operateurs quotés ou syntaxés !
110110

111111
(begin ; yes
112-
(display "psba 2 : infix detected ") (newline)
112+
;;(display "psba 2 : infix detected ") (newline)
113113

114114
(insert-tail-set! #;append-tail-set! result (!*prec-generic-infix-parser partial-result
115115
creator

scribblings/scheme-plus.scrbl

Lines changed: 114 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,119 @@
11
#lang scribble/manual
22

3-
@title{Scheme+ for Racket}
4-
3+
4+
@title[#:style '(toc)]{Scheme+ for Racket}
5+
6+
@author[(author+email "Damien Mattei" "[email protected]")]
7+
8+
source code: @url["https://github.com/damien-mattei/Scheme-PLUS-for-Racket"]
9+
10+
11+
@defmodule[SRFI-105 #:reader]{
12+
This reader package provides the SRFI-105 Curly Infix reader/parser.
13+
}
14+
15+
16+
17+
@defmodule[Scheme+]{
18+
This package provides the Scheme+ language definitions.
19+
}
20+
21+
22+
Scheme+ is an extension of the syntax of the Scheme language.
23+
24+
Scheme+ adds to Scheme a way to use also infix notation with a compatibility near 100% and not as a sub-system of Lisp syntax as it is often done but with a complete integration in the Scheme reader/parser system and also for Racket at REPL (Read Eval Print Loop).
25+
26+
Scheme+ is to Scheme what a concept-car is to automobile.Scheme+ is a concept-language.It is ideally what should be a modern Scheme.
27+
28+
Scheme+ makes it easy the assignment of Scheme objects in infix (works also in prefix) notation with a few new operators <- (or: ← , :=),⥆ (or <+) for definitions.
29+
30+
Scheme+ makes it easy the access and assignment for arrays,strings,hash tables,etc by allowing the classic square brackets [ ] of others languages.
31+
32+
33+
@table-of-contents[]
34+
35+
36+
@section[#:tag "installation"]{Scheme+ Installation and Depandencies}
37+
38+
Scheme+ can be installed via the Racket Package system or downloaded from Github.
39+
Scheme+ is designed to be used with the package SRFI-105 for Racket which is a curly infix reader also available in the same way described above.
40+
41+
@section[#:tag "syntax"]{Scheme+ Syntax and Conventions}
42+
43+
In general Scheme+ use the same convention for infix expression than SRFI-105 Curly Infix that is an infix expression is between curly parenthesis { }.
44+
But infix sub-expressions are allowed to be between normal parenthesis ( ). Infix or prefix is then autodetected,in cas of ambiguities { } force infix mode.
45+
46+
@codeblock|{
47+
#reader SRFI-105
48+
(require Scheme+)
49+
{3 * 5 + 2}
50+
17
51+
}|
52+
53+
54+
@codeblock|{
55+
#lang reader SRFI-105
56+
(require Scheme+)
57+
{3 · 5 + 2 ³}
58+
23
59+
}|
60+
61+
62+
@section[#:tag "reference"]{Scheme+ Reference}
63+
64+
65+
@subsection[#:tag "declarations"]{Declarations}
66+
67+
@defform[(declare name1 name2 ...)]{
68+
Declare new variables named @racket[name1],@racket[name2],....
69+
}
70+
71+
Note: this is rarely used,instead assignment macros are used but could be usefull in case a variable used in a block must be used outside too.
72+
73+
@subsection[#:tag "definitions"]{Definitions}
74+
75+
@defthing[⥆ macro]{}
76+
77+
@defform[{name <+ value}]{
78+
Define new variable @racket[name] and assign value @racket[value].
79+
}
80+
81+
Note: this is almost never used in Racket,because Scheme+ for Racket as a special feature of autodetection if a variable needs to be defined before assignment.
82+
83+
There is some alias of this:
84+
85+
@defform[{name ⥆ value}]{}
86+
87+
Note: a lot of operators of Scheme+ that works left to right exist in the opposite sense, i will document them as it is obvious,example:
88+
89+
@defform[{value ⥅ name}]{}
90+
91+
@subsection[#:tag "assignment"]{Assignments}
92+
93+
@defthing[← macro]{}
94+
95+
@defform[{name <- value}]{
96+
Assign to the variable @racket[name] the value @racket[value].
97+
}
98+
99+
@codeblock|{
100+
#lang reader SRFI-105
101+
(require Scheme+)
102+
{x <- 7}
103+
}|
104+
105+
There is some alias of this:
106+
107+
@defform[{name := value}]{}
108+
109+
110+
@defform[{name ← value}]{}
111+
112+
@codeblock{
113+
{M_i_o[j {i + 1}] <- M_i_o[j {i + 1}] + η · z_input[i] · მzⳆმz̃(z_output[j] z̃_output[j]) · ᐁ_i_o[j]}
114+
}
115+
116+
5117
The documentation is hosted on Github:
6118

7119
@hyperlink["https://github.com/damien-mattei/Scheme-PLUS-for-Racket/blob/gh-pages/README.md"]{Documentation of Scheme+ for Racket on Github pages}

0 commit comments

Comments
 (0)