Re: [racket-users] "Unbound Identifier" (Lists)

2021-02-24 Thread David Storrs
Hi IF, I think this is what you want. You were right about the issue -- you were consing onto the history list but then immediately throwing away the result because it wasn't modifying the original history value. #lang racket (struct message (str sender recipient) #:transparent) ; This returns

Re: [racket-users] Verifying the contract on a function

2021-02-24 Thread David Storrs
Aha. That and contract-equivalent? do what I need. Thanks, Sam. On Wed, Feb 24, 2021 at 10:20 PM Sam Tobin-Hochstadt wrote: > You can use the value-contract function, along with contract-stronger? to > do this. > > Sam > > On Wed, Feb 24, 2021, 6:03 PM David Storrs wrote: > >> I have some mac

Re: [racket-users] Verifying the contract on a function

2021-02-24 Thread Sam Tobin-Hochstadt
You can use the value-contract function, along with contract-stronger? to do this. Sam On Wed, Feb 24, 2021, 6:03 PM David Storrs wrote: > I have some macros that generate functions. For testing purposes, I'd > like to be able to ask the function "Do you have this contract > ?" Is there a way

Re: [racket-users] "Unbound Identifier" (Lists)

2021-02-24 Thread IF Karona
Thank you! I can get the code that follows to run, but the chatbot never replies. I surmise this is because lists are not mutable. With the background I have the most obvious way forward would be to use an array instead of a list, but that does not strike me as the best approach to take while try

[racket-users] Verifying the contract on a function

2021-02-24 Thread David Storrs
I have some macros that generate functions. For testing purposes, I'd like to be able to ask the function "Do you have this contract ?" Is there a way to do that? I've been digging through the Contracts section and googled for it but I'm not seeing one. -- You received this message because you

Re: [racket-users] "Unbound Identifier" (Lists)

2021-02-24 Thread George Neuner
Hi, Presumably you are using 'head' to get the first element of a list.   However, there is no function 'head' for lists. see:  https://docs.racket-lang.org/reference/pairs.html Try using 'first' and 'rest' instead of 'head' and 'tail'. George On 2/24/2021 3:55 PM, IF Karona wrote: Hi eve

[racket-users] "Unbound Identifier" (Lists)

2021-02-24 Thread IF Karona
Hi everyone, After trying to implement some changes Sage suggested (all errors are my own), I am now encountering the following message (courtesy of DrRacket): "head: unbound identifier in: head" Could someone help me find a fix? As before, I welcome suggestions on how to better do this the fu

Re: [racket-users] Parenthesizing infix expressions in Redex renderings?

2021-02-24 Thread Robby Findler
Yeah, I've been meaning to integrate those parts of that library into Redex proper but just haven't found the time. Also, I've thought it would be nice if Redex were able to look at the context of a particular, say, "or" or "then" expression and figure out if it needed parens. Sadly, for now you h

Re: [racket-users] Re: public email addresses on packages server

2021-02-24 Thread Roger Keays
I suppose another option would be to use one combined field with an email format like this: Tony Garnock-Jones "search-terms" might need some special attention though. You might be able to list two author terms, like this: "author:tonygarnockjo...@gmail.com" : true, "author:Tony G

Re: [racket-users] Re: public email addresses on packages server

2021-02-24 Thread Tony Garnock-Jones
Hi Roger, On Wed, 24 Feb 2021 at 15:55, Roger Keays wrote: > I was just thinking along the lines of adding a "name" field to the table > with the user/login data. If it is set, then it is displayed instead of the > email. You should be able to search by this field too of course. > That sounds s

Re: [racket-users] Re: public email addresses on packages server

2021-02-24 Thread Roger Keays
I was just thinking along the lines of adding a "name" field to the table with the user/login data. If it is set, then it is displayed instead of the email. You should be able to search by this field too of course. On Wed, Feb 24, 2021 at 12:47:27AM -0800, Tony Garnock-Jones wrote: > No, but it

Re: [racket-users] Parenthesizing infix expressions in Redex renderings?

2021-02-24 Thread David Thrane Christiansen
Thanks Ryan! There's all sorts of nice goodies in that library, like current-atomic-rewriters and friends. David Den ons. 24. feb. 2021 kl. 11.29 skrev Ryan Culpepper < rmculpepp...@gmail.com>: > The `binary-rw` function from unstable/gui/redex library has some support > for optionally parenthe

Re: [racket-users] Parenthesizing infix expressions in Redex renderings?

2021-02-24 Thread Ryan Culpepper
The `binary-rw` function from unstable/gui/redex library has some support for optionally parenthesizing its arguments. Ryan On Wed, Feb 24, 2021 at 11:07 AM David Thrane Christiansen < da...@davidchristiansen.dk> wrote: > Hello all, > > I'm working on coding up a little language model in Redex,

[racket-users] Parenthesizing infix expressions in Redex renderings?

2021-02-24 Thread David Thrane Christiansen
Hello all, I'm working on coding up a little language model in Redex, and I'd like to get it to render things in the form that my colleagues are used to. This means some infix operators as well as dealing with parenthesizing based on operator precedence. Here's a boiled-down sample of what I'm up

[racket-users] Re: public email addresses on packages server

2021-02-24 Thread Tony Garnock-Jones
No, but it's an interesting thought. It might be quite a lot of design work to come up with something that made sense, but would you like to sketch out a proposal here to make the idea a little more concrete? I can't promise anything, but it'd be good to know the kinds of requirements that might