[racket-users] A language and REPL for SRFI 105 "curly infix"

2021-12-31 Thread damien...@gmail.com


Hi,

i adapted a #lang and REPL for SRFI 105:
https://github.com/damien-mattei/library-FunctProg/blob/master/racket/SRFI-105.rkt
a simple example can be found here:
https://github.com/damien-mattei/library-FunctProg/blob/master/racket/examples-curly-infix.rkt
The two files must be in the same directory.
any files using curly infix notation must begin with:
#lang reader "SRFI-105.rkt"

example at REPL:
Welcome to DrRacket, version 8.2 [cs].
Language: reader "SRFI-105.rkt", with debugging; memory limit: 128 MB. 
> (define a 2)
> (define b -3) 
> (define c 5) 
> {{b expt 2} - {4 * a * c}} -31 

Any advice about other enhancements or other way to implement a REPL or 
language for SRFI 105 "curly infix" with Racket are welcome.

Regards,

Damien

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/9caab108-91ad-4680-988b-8f8ff0ace1ddn%40googlegroups.com.


[racket-users] Re: Racket Discourse

2021-11-23 Thread damien...@gmail.com
if i create an account following the link at the end of this message , i 
never get verification email at my google address i specified.

On Sunday, November 21, 2021 at 7:09:21 PM UTC+1 johnbclements wrote:

> TL;DR: Go to
>
> https://racket.discourse.group/invites/okLTSrQw1T
>
> and sign up for Racket Discourse (https://racket.discourse.group/)
>
> # Thoughts behind the move:
>
> Over time, it has become steadily more apparent that email-only 
> mailing lists are an outdated communication medium for the Racket
> community. More recent arrivals in our community have generally 
> chosen other platforms like slack or discord to carry on discussions. 
> As a result, the signal-to-noise ratio of the racket users mailing list 
> has dropped below the level of viability.
>
> In short, it’s time to give up on the mailing list.
>
> After a good deal of research, it looks like there’s room for a whole
> bunch of discussion platforms for Racket, but it also seems as though
> there should be a “permanent” one; it should be archived, it should be
> searchable in its entirety, and it should not tie us to someone else’s
> plan to monetize user data.
>
> Given these criteria, the winner is Discourse, an open-source
> messaging platform built by Jeff Atwood, Robin Ward, and Sam
> Saffron. It has a reasonable business model (they host projects like
> ours unless they get really big, whereupon you can either host it
> yourself or pay them to do it); it’s widely used by other language
> communities; and it appears to do most of what we want.
>
> # So where can I sign up?
>
> Sign up here: https://racket.discourse.group/invites/okLTSrQw1T
>
> The discourse platform has been in a “soft opening” phase for about 
> two weeks now, since RacketCon, and we have about a hundred users. 
> You’re receiving this message because we’d like to have *YOU* there 
> as well.
>
> # Can I still receive messages like a mailing list?
>
> Yes, you can. I have it enabled myself! 
> To use discord as a mailing-list:
> Sign up, go to Preferences > Email, and tick “Enable mailing list mode'.
>
> Yours,
>
> John Clements & Stephen De Gabrielle
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/a1cc04f5-25f6-4d0e-aeda-a656c18e5604n%40googlegroups.com.


[racket-users] Re: idea for enlighting Scheme syntax

2021-01-02 Thread damien...@gmail.com
to be complete , the form {varriable ← value} with curly brackets used in 
simple assignation works too in LET-ARROW*:
scheme@(guile-user)>  (let-arrow* ({x ← 1}
{y ← {x + 1}})
x
y)
$2 = 2

but the simpliest form works also:
(let-arrow* (x ← 1
 y ← {x + 1})
x
y)



On Saturday, January 2, 2021 at 12:04:35 PM UTC+1 damien...@gmail.com wrote:

> hello,
>
> i made a few macros for scheme syntax improvments.
> It uses infix Curly expressions syntax described in SRFI 105 
> and could be combined to use with SRFI 47 in multi dimensional arrays.
>
> Curly expressions allows out of the box syntax more mathematicals like:
>
> {c > t} instead of (> c t)
>
> my macros allows more:
>
> assignations of variables, examples:
> (define x '())
>  {x ← 2}
> it returns 2,the value of x
> {7 → x} ;; not my own idea suggested by my daughter studying python 
> because in math we can write 7 = x in an equation but not in python :-)
>
> {cpt <- 0}
> {cpt <- {cpt + 1}}
>
> but this would be not complete without a way to have vector and array 
> access and assignation too:
> (define T (make-vector 5))
> (vector-set! T 3 7)
> {T[3]}
> returns 7, the value of T[3]
>
> assignation of vector:
> {T[3] <- 7}
>
> works too with multidimensional arrays:
> (define a (make-array 999 '(1 2) '(3 4)))
> {a[2 4]}
> returns 999
>
> harder to code, affectaion between arrays and vectors :
> {T[3] <- T[4]}
> ;; assign and returns the value of T[3]
> '{T[3] <- T[4]}  will return :  (<- ($bracket-apply$ T 3) ($bracket-apply$ 
> T 4))
>
> {a[1 3] <- a[2 4]}
> {a[2 4] ← 7}
> {1 → a[2 4]}
>
> those works at toplevel of REPL and in statements or block of code or body 
> of lambda, now works too with LET end LET* and LETREC in the affectation 
> body and in the statements part:
>
> first a simplified LET named LOCAL as in CLOJURE Lisp that use less 
> brackets:
> (local [ x 1
> y (+ x 1)
> z (+ 2 y) ]
>  z 
>  y)
>
> returns 2
>
> new special forms :
>
>  (let-arrow* (x ← 1
>   y ← {x + 1})
>  y)
>
> returns 2
>
> (let-arrow* [ x 1 
>   y (+ x 1) 
>   z (+ 2 y) ]
>   z y)
>
> the same works with LETREC:
>
> (letrec-arrow* [ fact ← (lambda (n)
>(if  {n = 1}
> 1
> {n * (fact {n - 1})}))
>]
> (fact 5))
>
> ;; = 120
>
>
>
> this works with Guile Scheme, the implementation of macros needs only R5RS 
> scheme and the SRFI 105, i hope it could works a day in Racket and others 
> Scheme implementation .
>
> example in real code:
> https://github.com/damien-mattei/scheme4algo/blob/master/SssRec.scm#L245
>
> the code can be found here:
> for LET-ARROW* and LETREC-ARROW*: 
> https://github.com/damien-mattei/library-FunctProg/blob/master/let.scm#L85
>
> Bracket-apply overload and arrows assignations :
>
> https://github.com/damien-mattei/library-FunctProg/blob/master/array.scm#L131
>
> https://github.com/damien-mattei/library-FunctProg/blob/master/array.scm#L101
>
>
> I wrote a little outdated page blog about that:
> http://balistra.canalblog.com/archives/2020/12/01/38692230.html
>
> Racket use different schema for infix notation, one with ($ "string infix 
> expression") and another with . (dot) such as (x . + . 1) ,they are not 
> usable ,the latter . dot notation is a real nightmare. The best way would 
> be to overload the READER of REPL as described in SRFI 105 Curly 
> expressions.
>
> Damien
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/f5c24ed0-6981-46d1-b712-481ce728a8e8n%40googlegroups.com.


[racket-users] idea for enlighting Scheme syntax

2021-01-02 Thread damien...@gmail.com
hello,

i made a few macros for scheme syntax improvments.
It uses infix Curly expressions syntax described in SRFI 105 
and could be combined to use with SRFI 47 in multi dimensional arrays.

Curly expressions allows out of the box syntax more mathematicals like:

{c > t} instead of (> c t)

my macros allows more:

assignations of variables, examples:
(define x '())
 {x ← 2}
it returns 2,the value of x
{7 → x} ;; not my own idea suggested by my daughter studying python because 
in math we can write 7 = x in an equation but not in python :-)

{cpt <- 0}
{cpt <- {cpt + 1}}

but this would be not complete without a way to have vector and array 
access and assignation too:
(define T (make-vector 5))
(vector-set! T 3 7)
{T[3]}
returns 7, the value of T[3]

assignation of vector:
{T[3] <- 7}

works too with multidimensional arrays:
(define a (make-array 999 '(1 2) '(3 4)))
{a[2 4]}
returns 999

harder to code, affectaion between arrays and vectors :
{T[3] <- T[4]}
;; assign and returns the value of T[3]
'{T[3] <- T[4]}  will return :  (<- ($bracket-apply$ T 3) ($bracket-apply$ 
T 4))

{a[1 3] <- a[2 4]}
{a[2 4] ← 7}
{1 → a[2 4]}

those works at toplevel of REPL and in statements or block of code or body 
of lambda, now works too with LET end LET* and LETREC in the affectation 
body and in the statements part:

first a simplified LET named LOCAL as in CLOJURE Lisp that use less 
brackets:
(local [ x 1
y (+ x 1)
z (+ 2 y) ]
 z 
 y)

returns 2

new special forms :

 (let-arrow* (x ← 1
  y ← {x + 1})
 y)

returns 2

(let-arrow* [ x 1 
  y (+ x 1) 
  z (+ 2 y) ]
  z y)

the same works with LETREC:

(letrec-arrow* [ fact ← (lambda (n)
   (if  {n = 1}
1
{n * (fact {n - 1})}))
   ]
(fact 5))

;; = 120



this works with Guile Scheme, the implementation of macros needs only R5RS 
scheme and the SRFI 105, i hope it could works a day in Racket and others 
Scheme implementation .

example in real code:
https://github.com/damien-mattei/scheme4algo/blob/master/SssRec.scm#L245

the code can be found here:
for LET-ARROW* and LETREC-ARROW*: 
https://github.com/damien-mattei/library-FunctProg/blob/master/let.scm#L85

Bracket-apply overload and arrows assignations :
https://github.com/damien-mattei/library-FunctProg/blob/master/array.scm#L131
https://github.com/damien-mattei/library-FunctProg/blob/master/array.scm#L101


I wrote a little outdated page blog about that:
http://balistra.canalblog.com/archives/2020/12/01/38692230.html

Racket use different schema for infix notation, one with ($ "string infix 
expression") and another with . (dot) such as (x . + . 1) ,they are not 
usable ,the latter . dot notation is a real nightmare. The best way would 
be to overload the READER of REPL as described in SRFI 105 Curly 
expressions.

Damien



-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/57244a1b-7503-4b63-b5e5-ac7294bcf2bcn%40googlegroups.com.