mflatt
2020-10-24 13:55:48

Thanks! Looks like John got that one just after v7.8: https://github.com/racket/racket/commit/39a8a50d0ae3d96cfeefd3e92de061ecc280a4c0


laurent.orseau
2020-10-24 15:16:07

Now with Save and Open. I should probably make it a package at this point…


blerner
2020-10-24 19:39:07

is there an easy way to convince the reader to read . as just a symbol, rather than triggering infix-conversion or prohibiting it altogether (via read-accept-dot = #f, or read-accept-infix-dot = #f)?


soegaard2
2020-10-24 19:40:19

My gut reaction is “no”.


soegaard2
2020-10-24 19:40:34

But maybe a reader-macro can be used?


blerner
2020-10-24 19:41:55

my scenario is, I’m trying to read-syntax, and I want to get verbatim close to the originally-typed syntax as possible. But e.g. (1 . < . 2) reads as (< 1 2) and the srcloc information is all messed up


soegaard2
2020-10-24 19:43:40

From the docs of read-table: char like-char readtable — causes char to be parsed in the same way that like-char is parsed in readtable, Maybe you can make . read the same way as, say, a ?



soegaard2
2020-10-24 19:44:54

Since the parameter current-readtable controls the read-table used by read I think it could work.


blerner
2020-10-24 19:47:54

that did it, thanks!


blerner
2020-10-24 19:51:28

now I just have to get it to work in the rest of my program; it seems to be being ignored at the moment :disappointed:


soegaard2
2020-10-24 19:52:17

I think, I saw a package for “programmatic editing” at some point. Perhaps it was your package?


blerner
2020-10-24 19:54:15

nope, not me, sorry


soegaard2
2020-10-24 19:55:26

Found it. https://docs.racket-lang.org/progedit/index.html Don’t know if it handles double-dots.


anything
2020-10-24 22:08:31

Does Racket have set-car! and set-cdr!? I could swear I’ve used those before. Were they removed? If so, how do you now accomplish what they used to do?




anything
2020-10-24 22:23:47

Thank you so much! I appreciate it!


kellysmith12.21
2020-10-24 22:29:44

That’s fantastic, @camoy, thanks!


anything
2020-10-25 00:19:50

A mutable hash table is not considered functional programming, is it?


notjack
2020-10-25 00:25:57

Usually mutable state slants more towards the imperative end. It’s a vague and subjective thing however, and that doesn’t mean using a mutable hash table is “bad”.


sorawee
2020-10-25 00:43:50

I don’t even know what “functional programming” means.

If functional programming means no side-effects, then why is there a term “purely functional”? Doesn’t that imply that regular functional programming is usually not “pure”?

My favorite view of functional programming is a style where we strive to write functions that are mathematically functional (same input => same output). This view allows us to have some degrees of side effect in a function.


notjack
2020-10-25 01:01:48

I’d say using higher-order functions is the most important part of functional programming, and it happens that higher order functions tend to be more useful when you give them functions without side effects