nma.arvydas.silanskas
2019-7-17 07:14:25

recursion (and usually in tail position) is usually used in functional / immutable context


kokou.afidegnon
2019-7-17 08:32:26

thanks


soegaard2
2019-7-17 09:37:01

Look at the data type. If the data type is recursive (I.e. it refers to itself) then it is natural to write a recursive function.


soegaard2
2019-7-17 09:38:35

The simplest recursive data type is the singly linked list. So that’s why so much time is spent explaining how to write functions that deal with lists.


spdegabrielle
2019-7-17 12:49:15

would anyone object if I created a #Racket2 channel?


spdegabrielle
2019-7-17 12:56:06

Friday, 19 July at 12pm–3pm there will be an impromptu Racket meetup at the cafe at the British Library ‘The Last Word’ see https://goo.gl/maps/M62e4b9JK7c1oaA69

No agenda. All welcome. Spread the word!

I’ll be drinking tea, eating cake(I hope), and will be easily identified as a the man with racket logo on his laptop. Updates on #uk channel


kokou.afidegnon
2019-7-17 13:15:10

reading libraries at https://docs.racket-lang.org/mrlib/index.html there is no visual representation of the APIs, it will be best of done so we don’t need to test everything


soegaard2
2019-7-17 15:04:20

@kokou.afidegnon Yeah screenshots would have been nice.


alexknauth
2019-7-17 15:36:12

@sorawee Can I reply to your comment about “keywords are currently not extensible by clients” and auxiliary-macro-contexts here instead of on the issue for making a pattern-matching RFC?


notjack
2019-7-17 17:52:22

@spdegabrielle I think that’s a great idea


spdegabrielle
2019-7-17 18:15:03

#racket2 :arrow_heading_down:


mflatt
2019-7-17 18:16:30

I agree - thanks for creating the channel!


nma.arvydas.silanskas
2019-7-17 18:21:23

wait, racket2? what is it


mflatt
2019-7-17 18:26:54

This may ask more questions than it answers, but: https://groups.google.com/d/msg/racket-users/3aIPOGbGgmc/A4HHSbdxAwAJ


nma.arvydas.silanskas
2019-7-17 18:59:00

is tldr native infix notation?


markus.pfeiffer
2019-7-17 19:00:06

no


markus.pfeiffer
2019-7-17 19:00:16

not as such at least


markus.pfeiffer
2019-7-17 19:01:29

TL;DR is that @mflatt made a suggestion at RacketCon to change the syntax for racket2 with the goal of making it more palatable for… lets say non-()-nerds


markus.pfeiffer
2019-7-17 19:02:21

he keeps stressing that this was a suggestion and there should be a discussion and a process that might lead to new syntax


markus.pfeiffer
2019-7-17 19:02:49

some people have made pretty good contributions already in my opinion


markus.pfeiffer
2019-7-17 19:07:39

to be honest, @mflatt’s talk included quite a few other things one could do, the syntax one was the controversial one :wink:


nma.arvydas.silanskas
2019-7-17 19:10:56

but () is kinda one of the selling points in lisp, no?


nma.arvydas.silanskas
2019-7-17 19:11:16

data-like syntax gives easy way to make extensions in the form of syntax macros


spdegabrielle
2019-7-17 19:11:36

@sanchom there is a issue ‘Make an RFC for Matthew’s 3 syntactic principles’ at https://github.com/racket/racket2-rfcs/issues/3


spdegabrielle
2019-7-17 19:12:47

Save me from re-watching..what were the other things? (I think I was blinded by the syntax thing)


nma.arvydas.silanskas
2019-7-17 19:13:56

Java has macros in the form of annotation processors, and yet your average Joe doesn’t even know about it, since it’s pain to use


nma.arvydas.silanskas
2019-7-17 19:14:39

and it’s not like they didn’t try to make it nice and all, but the thing is, language syntax design doesn’t really open up itself for such thing


markus.pfeiffer
2019-7-17 19:16:19

Things like compiling to web-assembly, supporting ARM64


markus.pfeiffer
2019-7-17 19:16:26

aren’t the slides online?


spdegabrielle
2019-7-17 19:16:38

I didnt think of that


spdegabrielle
2019-7-17 19:16:39

brb


spdegabrielle
2019-7-17 19:18:32

then normally turn up at https://con.racket-lang.org/#schedule but they are not there yet


spdegabrielle
2019-7-17 19:34:13

I’ve made a #racket2 channel


spdegabrielle
2019-7-17 19:36:23

I’ve suggested using the scribble at-exp syntax for algebra-style function notation: function(arg, ...)


nma.arvydas.silanskas
2019-7-17 19:37:02

how is @something better than (something


nma.arvydas.silanskas
2019-7-17 19:38:19

might be just me, but at-syntax is.. hard on the eyes (though very handy in template context like html)


spdegabrielle
2019-7-17 19:38:50

unambiguous mapping from fn(…) to (fn …) ?


spdegabrielle
2019-7-17 19:39:57

I’m not worried about losing Racket1 syntax as it is clear that isn’t going away.


spdegabrielle
2019-7-17 19:42:08

As long as there is a unambiguous 2-way mapping between racket1 and racket2 I’m thinking macros might be built in Racket1 then compiled into Racket2? (or is that an insane idea)


spdegabrielle
2019-7-17 19:42:51

should we move this discussion to #racket2 ?


nma.arvydas.silanskas
2019-7-17 20:47:37

tbh no, I don’t think I’m in position to argue one way or another at this point in time for I’m relatively inexperienced, and this is very vague topic yet


nma.arvydas.silanskas
2019-7-17 20:47:43

perhaps when something more concrete emerges


spdegabrielle
2019-7-17 20:49:04

Neither am I :grinning:


spdegabrielle
2019-7-17 20:50:23

And inexperienced perspectives are valuable - everyone starts out inexperienced, but it’s hard to remember it that was like.


krismicinski
2019-7-17 21:07:30

Does anyone know of a good rainbow blocks mode for emacs that plays nicely with Racket?


krismicinski
2019-7-17 21:07:43

I wanted to try one out, but several that I looked into do not appear to be working.


sorawee
2019-7-17 21:23:02

Yes!


calvin
2019-7-17 22:27:55

@calvin has joined the channel


alexknauth
2019-7-17 23:36:57

Lets say I have a macro m, and it allows the keywords #:a, #:b, and #:c. However, I want it to be extensible if someone defines an m-expander, they can expand to some combination of those keywords.

As the implementor of m I can define the calling-convention for m-expanders to return a list of syntax objects, which I will splice into m. (define-m-expander extension [(_ stuff ...) #'(#:a a #:b b #:c c)]) And then use the extension inside m (m (extension stuff ...)) ; =expands-into> ; (m #:a a #:b b #:c c) And the same thing applies to match-expanders, if m was a match-expander and extension is defined as an m-expander only valid within m.

However, allowing unquoted keywords as normal patterns does not help this, and in my opinion it makes this less-useful because of the ambiguity. Imagine m also had a by-position argument x. (m x #:a a #:b b #:c c) or (m #:b b #:a a x #:c c) Now if m is a match expander unquoted keywords can be normal patterns, then x being #:a, #:b, or #:c makes it ambiguous. (m #:b b #:a a #:c #:c c) However if match patterns need a quote in front of a keyword in order to match a keyword value, then that takes away the ambiguity (m #:b b #:a a '#:c #:c c) Now it’s clear that the x argument is '#:c, and in the match-expander, the match will only succeed if the x field is the value '#:c


sorawee
2019-7-18 00:05:19

I think we are talking about orthogonal issues (but I understand your points above)

What I don’t like is that with keywords, clients can’t extend the macro with more keywords. They can indeed extend the macro with expanders as you illustrate above, but then things are not uniform.


sorawee
2019-7-18 00:08:33

E.g., it doesn’t make sense to write

(define-syntax-parse-expander #:hello ....)

(define-simple-macro (foo)
  #:with ...
  #:hello ...
  ...)

Instead, we would need to write

(define-syntax-parse-expander hello ....)

(define-simple-macro (foo)
  #:with ...
  {hello …}
  ...)

And what I’m saying is that, why don’t we make things uniform in the first place. E.g.,

(define-syntax-parse-expander hello ....)

(define-simple-macro (foo)
  {with ...}
  {hello …}
  ...)

abmclin
2019-7-18 00:26:08

Amusing quote from https://m00natic.github.io/lisp/manual-jit.html#fn.13

... from Common Lisp's perspective but Racket seems to have even more elaborate macro phase system. Part of the reason is Racket, being a Scheme descendant, has single namespace for functions and variables (Lisp-1). And all those crazy academics!

jesse
2019-7-18 06:18:11

@krismicinski are you talking about something like this? https://www.emacswiki.org/emacs/RainbowDelimiters