We all live in a hollow world anyway, and variables are just the projection of internal mechanics. Deal with it, people! :wink:
I’m a little confused about what you’re trying to do, but maybe using prop:match-expander
as well would help.
A comp sci prof friend of mine is learning Racket and using #lang eopl
and was surprised he had to require stuff from Racket such as add1
, foldl
, andmap
, etc. - does that sound right that those are not available by default?
The docs do state, “The Essentials of Programming Languages language in DrRacket provides a subset of functions and syntactic forms of racket” - I wonder why that is.
Seems weird - the teaching languages normally have what you need for the particular text
Maybe he is going beyond the exercises in the text?
(To my shame I have a copy that I have never opened)
I think EOPL is R5RS with a few extra forms for defining ~structs~ ~records~ data types. https://docs.racket-lang.org/eopl/index.html And neither add, foldl nor andmap are in R5RS.
The authors provide files to run EOPL programs in standard Scheme too: http://www.eopl3.com/
You’re not talking about Jeff T at a uni in NC, are you?
I’m attempting to get an identifier to behave like the identifiers created by define struct (e.g. it acts like a function when in an apply position, expands to a correct match expression). I was hoping that a mixture of the prop:rename
, prop:struct-info
and prop:match-expander
would let me emulate the behaviour.
I am :)
I’m TA’ing for that class with him, good to know :slightly_smiling_face:
Small world :) I’m in the Triangle also. Are you in the Triangle Devs Slack?
Small indeed! No, didn’t know that existed.
I’ll get you a link to the inviter…
I believe it should also work to start with #lang racket/base
or #lang racket
and then (require eopl)
. The require will shadow a few Racket names, but you’ll keep foldl
, andmap
, etc. (But not add
. Did you mean add1
?)
@ryanc yes, I meant add
- I’ll edit the above …
@amal has joined the channel
Are there use cases for mutable strings that can’t be better solved by other approaches?
I think Racket’s fixed length mutable strings have few uses
Mostly because it’s not even possible to replace one logical character by another, because some Unicode glyphs are described by two racket characters
I’m guessing that mutable byte strings have some uses?
yes, the usual advantages of mutable data for efficiency