Re: [racket-users] How 'Pythonic' Can Racket Be Made?

2023-10-10 Thread D. Ben Knoble
e: >> >> Unlike, e.g., Google? >> >> On Oct 10, 2023, at 12:11 PM, Adam Golding wrote: >> >> Yikes, how do we protest introducing a dependency on some corporation? >> >> On Tue, 10 Oct 2023 at 12:09, D. Ben Knoble wrote: >>> >>> You

[racket-users] Re: How 'Pythonic' Can Racket Be Made?

2023-10-10 Thread D. Ben Knoble
You'll probably get more replies on Discourse. A short answer is to mention Rhombus and to recommend looking at all the #langs on the package server and in the docs. On Monday, October 9, 2023 at 1:35:11 PM UTC-4 Adam Golding wrote: > I am going to write a language called 'micronatrix' that is

[racket-users] Re: how could I obtain more context to isolate the problem?

2022-08-09 Thread D. Ben Knoble
Are you passing the `?` to `raco setup`? If so, I suspect your shell is expanding that to a file or directory named `t` (which matches the glob `?`), which is then used as a collection name. On Monday, August 8, 2022 at 12:43:27 PM UTC-4 infodeve...@gmail.com wrote: > $ raco setup ? > collectio

Re: [racket-users] using neg-propositions in partition?

2021-10-05 Thread Ben Greenman
There's an issue open about partition: https://github.com/racket/typed-racket/issues/138 Does `my-partition` work like you'd want? Based on Alex's last comment on the issue, it seems hard to give a predicate that matches the type. (Whenever I've wanted `partition` in typed code, I was always ab

Re: [racket-users] Having trouble getting documentation to generate

2021-09-28 Thread Ben Greenman
On 9/28/21, David Storrs wrote: > *fists of rage* > > I'm glad it worked for you, and that it works for me if I repeat your > steps. I have no idea why it wasn't working given that I was using the > local copy of the git repository that is the source of what's on github. > Argh. Weird ... glad i

Re: [racket-users] Having trouble getting documentation to generate

2021-09-28 Thread Ben Greenman
main.rktscribblings > raco pkg install Linking current directory as a package The following uninstalled packages are listed as dependencies of try-catch: test-more Would you like to install these dependencies? [Y/n/a/c/?] y Resolving "test-more" via https://pkgs.racket-lang.or

Re: [racket-users] Syntax Parse Bee 2021

2021-09-15 Thread Ben Greenman
syntax classes. Still others are more like starter code for a new DSL. The code inside these submissions is **very** informative. Whether you're new to macros or a seasoned syntax parser, there is a lot to learn from. - Ben + Stephen On 8/26/21, Ben Greenman wrote: > On 8/25/21, Stephen De G

[racket-users] Re: Is this "inside out" macro technique common?

2021-08-13 Thread D. Ben Knoble
Ah, I'm now seeing that with-quasi implicitly #`s the body; I believe with syntax-parse, #:with, and #' + template vars + #` when needed you might be ok. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop r

[racket-users] Re: Is this "inside out" macro technique common?

2021-08-13 Thread D. Ben Knoble
> A shortcut to answering my question would be to tell me that `with-quasisyntax` in the following paste already exists: http://pasterack.org/pastes/48885 Without taking a detailed look, is there anything about with-quasisyntax that with-syntax

Re: [racket-users] Equivalent of exec

2021-08-04 Thread D. Ben Knoble
Hi Norman, > It's slightly unfortunate that Racket's > start-up time make it slightly suboptimal as a command-line tool, but > raco make helps with that. With 8.0+/CS, even without make I've had a good experience. As you say, setup or make makes things even faster, though. If you weren't already

Re: [racket-users] Equivalent of exec

2021-08-04 Thread D. Ben Knoble
> (exit (system*/exit-code "/usr/bin/vi" "filename")) On a slightly unrelated note, if this for consumption by anyone other than just you, I would use (getenv "EDITOR") (or VISUAL, if you prefer) rather than hard-code the path to vi. Best, D. Ben Knoble --

Re: [racket-users] Re: A language for command line interfaces

2021-07-25 Thread D. Ben Knoble
> Right, thank you for bringing that up. I should have mentioned that the #lang > provides all of racket/base at the module level, so you can write normal > Racket code (including `require`), and any imports at the module level would > be available within the `program` body since it compiles dow

[racket-users] Re: A language for command line interfaces

2021-07-25 Thread D. Ben Knoble
> The language is composed of 5 forms - help, flag, constraint, program, > and run. With these 5 forms, you get all of the functionality of the > built-in parse-command-line form, and with syntax that's much simpler. In > fact, the nontrivial forms of the language simply use Racket's normal >

Re: [racket-users] How to set type signature for recursive lazy list

2021-07-14 Thread Ben Greenman
On 7/14/21, Kiong-Gē Liāu wrote: > Thanks, following Ben's suggestion that follow code works Great! -- 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-user

Re: [racket-users] How to set type signature for recursive lazy list

2021-07-13 Thread Ben Greenman
On 7/13/21, Kiong-Gē Liāu wrote: > Ben, > > Thanks, changing "stream" to "stream apply" does solve the issue. > > I tried to push it further little bit with the following code to see if > typed racket can support generic like Haskell or Scala: > >

Re: [racket-users] How to set type signature for recursive lazy list

2021-07-12 Thread Ben Greenman
On 7/11/21, Kiong-Gē Liāu wrote: > Hi, in non-typed racket, I can define a generalized Fibonacci sequence > > X[n+k] = f(X[n], X[n+1], , X[n+k-1]) > > using the following code > > #lang racket > > (require racket/stream) > > (define (gfib f xs) > (define (gfib_t xs) > (stream-cons (last

[racket-users] Syntax Parse Bee 2021

2021-06-30 Thread Ben Greenman
he old macro more maintainable, more robust against errors, and/or more flexible. Updates will be via Racket News, Racket-Users, Slack, Discord & Reddit. Whatever you decide, we hope that you learn and have fun! - Ben + Stephen PS a 'Bee' is a community effort toward a common goal.

Re: [racket-users] Could Racket be used as a "frontend" for a non-Racket language?

2021-06-22 Thread D. Ben Knoble
No idea if this is what you're looking for, but I have a feeling it wouldn't be terribly difficult to design a #lang where modules were programs that, when run, output C# code (kind of like how scribble & pollen can output HTML). Then you could have a language (w/ or w/o) macros that gets run d

Re: [racket-users] Plot Problem: No Line; Bounds not found

2021-06-15 Thread Ben Greenman
On 6/15/21, Britt Anderson wrote: > Thanks for the help to my specific problem. More generally, what should > have clued me in to a contract or type error when the only message received > had to do with y plot bounds? Just looking for practical advice to help me > figure out things on my own going

Re: [racket-users] Plot Problem: No Line; Bounds not found

2021-06-15 Thread Ben Greenman
On 6/15/21, Britt Anderson wrote: > > I was starting to explore plot and I am getting a behavior I do not > understand. plot doesn't seem to be able to figure out the bounds for > something that seems pretty straight-forward. When I give bounds as an > optional argument I don't see the line I expe

[racket-users] Racket Slack archive update: privacy concerns

2021-06-09 Thread D. Ben Knoble
Update on the project to host an archive of the Racket Slack: I have been directed to some privacy issues with the current proof-of-concept. Until these issues are resolved, I have made the repository private and taken down the site. If you have a copy of the archive files or site, I must ask th

Re: [racket-users] Racket Slack archive [help wanted]

2021-06-08 Thread Ben Knoble
D. Ben Knoble > 1) It wasn’t immediately clear to me that the links were the names of > channels. It seems painfully obvious to me now, but perhaps it’s worth > starting all the names with hashes? Great idea, thanks. > 2) Clicking on the channel name “general” appears to melt

[racket-users] Racket Slack archive [help wanted]

2021-06-08 Thread D. Ben Knoble
In case you missed it/aren't on Slack: The latest version of the Slack archive is up-and-running at https://benknoble.github.io/racket-slack-archive/ (extends through roughly 2021-06-07). The site is now built using a mix of - Racket (data processing, mostly the json, hash, and unzip modules)

Re: [racket-users] Can a new user defined pkg encompass nothing more than references to previously defined pkgs?

2021-06-06 Thread Ben Greenman
On 6/6/21, Don Green wrote: > > Can a new user defined pkg encompass nothing more than references to > previously defined pkgs so that every user created module references a > single user defined pkg? Yes. You can make a new package whose main.rkt provides lots of identifiers from other packages

Re: [racket-users] Is there a good Racket DSL alternative to Image Magick?

2021-05-12 Thread Ben Greenman
On 5/12/21, Robert Haisfield wrote: > Daniel, that's awesome. How would I filter down this list according to the > regex? > > (define list-of-files (map path->string (directory-list starting-path))) You can wrap it in a filter: (define list-of-files (filter (lambda (str) (regexp-match? "\\.png

Re: [racket-users] student produces absolutely bonkers environment lookup code

2021-05-07 Thread Ben Greenman
On 5/7/21, Shu-Hung You wrote: > Not that I have any idea of what's going on, but interestingly, Typed > Racket's second ->* example has (1)(3)(4). The use of list* may be > possible if one follows the type (List* String Natural x) in the > example. > > https://docs.racket-lang.org/ts-reference/ty

Re: [racket-users] Package install conflicts on the Racket package catalog

2021-05-05 Thread Ben Greenman
On 5/5/21, Siddhartha Kasivajhula wrote: > Thank you, that helped me understand the issue. I've made the appropriate > changes so hopefully that'll do it. > > This is reminding me that in python package distribution land, you are able > to explicitly indicate which files make it into the package i

Re: [racket-users] Typed Racket: type relations

2021-04-19 Thread Ben Greenman
3. I don't see any boundaries where you describe -- can you say more? >>> >>> Run typed-performance.rkt and see: >> >> This might be related to >> https://github.com/racket/typed-racket/issues/289. >> > > So basically my unsafe-reprovide module should probably use some syntax > trickery to gen

Re: [racket-users] Re: How do I debug this performance problem?

2021-04-05 Thread Ben Greenman
> I've noticed that Typed Racket adds seemingly unnecessary chaperones when > the Any type is involved, but maybe they are necessary for some reason? The > following code tries to create a chaperone that I don't think is necessary. > > #lang racket > > (module m typed/racket > (provide f) > (:

Re: [racket-users] Sticky scrollable nav bar in docs

2021-02-18 Thread Ben Greenman
"sticky" looks worse to me on that example page --- I have to scroll to the bottom of all the set docs before I can read the navbar On 2/18/21, Yury Bulka wrote: > I agree this is a useful improvement. I would consider using "position: > sticky" instead of "position: fixed" as that is generally l

Re: [racket-users] file/gzip trouble reading

2021-02-16 Thread Ben Greenman
On 2/16/21, Dominik Pantůček wrote: > > On 16. 02. 21 22:27, Matthew Flatt wrote: >> At Tue, 16 Feb 2021 16:03:29 -0500, Ben Greenman wrote: >>> Sadly, I've already compressed a few files using >>> `call-with-output-string` ... is there an easy way to de

Re: [racket-users] file/gzip trouble reading

2021-02-16 Thread Ben Greenman
On 2/16/21, Matthew Flatt wrote: > At Tue, 16 Feb 2021 15:44:54 -0500, Ben Greenman wrote: >> But in my compressed string, the second >> byte is #o357 for some reason. I'm not sure how that could have >> happened ... some kind of encoding issue with string ports? > &

[racket-users] file/gzip trouble reading

2021-02-16 Thread Ben Greenman
I'm trying to use `gzip-through-ports` and I haven't been able to unzip compressed data. Here's a tiny example. I think this should print "hello world": ``` #lang racket (require (only-in file/gzip gzip-through-ports) (only-in file/gunzip gunzip-through-ports)) (define src "hello world") (

Re: [racket-users] History changes

2021-01-10 Thread Ben Greenman
> It would be nice if I don’t have to modify scribble-lib, or, failing that, > avoid touching documenting forms. Isn’t it possible for history to know > which defform it’s under? A history might not appear under a defform (for better or worse). Maybe it's easier to give a list of links to the new

Re: [racket-users] Tools and Syntax Highlighting

2021-01-06 Thread Ben Ryjikov
Hi Robby and Stephen, Thanks for your suggestions! It’s working now thanks to a mix of rackunit tools and dynamic require. We’re also thinking about how to make our code less reliant on DrRacket. Best, Ben > On Jan 4, 2021, at 8:11 PM, Robby Findler wrote: > > I think a good first

Re: [racket-users] Tools and Syntax Highlighting

2021-01-04 Thread Ben Ryjikov
share code. Is there a way for a tool to access code which outside of the tool at runtime? -Ben > On Jan 4, 2021, at 9:04 AM, Stephen De Gabrielle > wrote: > > On Mon, Jan 4, 2021 at 12:32 AM Ben Ryjikov <mailto:bryji...@gmail.com>> wrote: > Hi Racket, > > Is it

[racket-users] Tools and Syntax Highlighting

2021-01-03 Thread Ben Ryjikov
that would do this? Thanks for your time and Happy New Year! Best, Ben -- 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...@google

Re: [racket-users] Scribble and main.rkt

2020-12-22 Thread Ben Greenman
> Is it correct that calling the main file of the package something else than > main.rkt is bad style, unsupported by Scribble? It's okay to call the main file something else, but you'll have to tell Scribble about it. Right now, I guess you have a @defmodule[typed-compose]{} somewhere. That

Re: [racket-users] compose in Typed Racket

2020-12-10 Thread Ben Greenman
>> A package for compose-n and compose-3 to like 10 or 20? Yes I like the idea of _small packages that do one thing_ better than _one-stop all-utility packages_ ... but do what you think makes sense. >> Someday later, perhaps poly dots and #:rest-star can combine to >> improve the built-in type.

Re: [racket-users] compose in Typed Racket

2020-12-09 Thread Ben Greenman
> If the answer is no, is there any interest in including these three > functions (as well as compose-5, 6, 7, 8) into Typed Racket? I think these would be excellent in a package. Someday later, perhaps poly dots and #:rest-star can combine to improve the built-in type. -- You received this mes

Re: [racket-users] multi line scribble text body in web-server template

2020-11-01 Thread Ben Greenman
Thats the nor On 11/1/20, krs...@gmail.com wrote: > > Hi!, > > I am using web-server/templates > . > I am confused why this just displays the last line?: > > @when[#t]{ > first > second > } That's normal "when" behavior ```

Re: [racket-users] Contracts for (partially) specifying dictionary key -> value-predicates

2020-10-31 Thread Ben Greenman
On 10/31/20, jackh...@gmail.com wrote: > I'm not sure, but I have a feeling Ben's suggestion to make them functions > instead of macros wasn't about the performance implications of macros. Right. I was only thinking that macros are hard to build on. But then, I can use dictof/proc here. -- You

[racket-users] large hash/dc errors (was: Contracts for (partially) specifying dictionary key -> value-predicates)

2020-10-30 Thread Ben Greenman
> Ben: if you have an example of the bad hash/dc error message I'd be > interested to see it. > > Robby Here's the kind of message that turned me off: ``` ctc.rkt:34:0: broke its own contract promised: (hash/dc (k (or/c (quote a) (quote b) (quote c))) (v (k) (config-valu

Re: [racket-users] Contracts for (partially) specifying dictionary key -> value-predicates

2020-10-30 Thread Ben Greenman
On 10/29/20, William J. Bowman wrote: > I'm considering implementing, maybe as a library or a pull-request to > racket/dict, contracts for (partially) specifying which keys exist in a > dictionary and a contract for the value on that key. Great! Please make the contract error messages point out

[racket-users] Re: Typed Racket Survey — RSVP

2020-10-23 Thread Ben Greenman
Reminder: the survey will close at the end of this weekend (Sunday Oct 25 11:59pm anywhere on earth). Thank you to everyone that's filled it out so far! On 10/17/20, Ben Greenman wrote: > Hi Racketeers, > > Hope you are having a great RacketCon weekend. > > Typed Racket w

Re: [racket-users] [racket users] Macros sharing data?

2020-10-21 Thread Ben Greenman
You can use syntax-local-value to communicate across macros. Here's an example: https://docs.racket-lang.org/syntax-parse-example/index.html?q=cross-macro#(mod-path._syntax-parse-example%2Fcross-macro-communication%2Fcross-macro-communication) On 10/21/20, Kevin Forchione wrote: > Hi guys

[racket-users] Typed Racket Survey — RSVP

2020-10-17 Thread Ben Greenman
. Even if you've never used --- or even heard about --- Typed Racket, we want to hear from you! https://tinyurl.com/typed-racket-survey Feel free to email Ben if you have more feedback or questions. The survey will remain open for 1 week. After it's closed, we will share the (anonymize

Re: [racket-users] [scribble] Are nested lists possible?

2020-10-13 Thread Ben Greenman
On 10/13/20, David Storrs wrote: > @itemlist[ > @item{The size cage needed depends on the type of dog > @itemlist[ > @item{Pug: Small} > @item{Collie: Medium} > @item{Mastiff: Large}]}] > > I would like to produce something that looks like this: > >- The size cage needed depe

Re: [racket-users] Scribbling hexadecimal values

2020-09-18 Thread Ben Greenman
+1 For now, I've used hacks like `(string->number "#x...")` for typesetting https://docs.racket-lang.org/pict-abbrevs/index.html On 9/18/20, Dominik Pantůček wrote: > Hello Racketeers, > > I am struggling to make scribble typeset default values in > proc-doc/names in hexadecimal. An example woul

Re: [racket-users] Advice for beginner

2020-09-08 Thread Ben Greenman
The student languages are not subsets of Racket. On 9/7/20, Denis Maier wrote: > > Hi, > > I've started working with the Htdp textbook as I'd like to acquire a solid > foundation in (functional) programming. The approach to teaching > programming looks very promising. Having this ressource avail

Re: [racket-users] Proper place to store log file

2020-08-24 Thread Ben Greenman
On 8/24/20, Thomas Del Vecchio wrote: > Hi everyone! > > I'm currently working on some usage logging for a language we're > developing. We need to store a persistent file that is shared across a > given device (so that the same log file is used regardless of where you are > > working). Is there a

Re: [racket-users] Replace pre-installed rackunit with git source

2020-07-22 Thread Ben Greenman
On 7/22/20, Sam Tobin-Hochstadt wrote: > To figure out where things are, I recommend the `raco fc` command, > which is in the `raco-find-collection` package. > > Almost certainly what went wrong is that you installed the cloned > `rackunit` directory as a package. Instead, you need to install all

Re: [racket-users] require and syntax-case

2020-07-13 Thread Ben Greenman
On 7/13/20, Roman Klochkov wrote: > I tried > ``` > (define-syntax my-file > (make-require-transformer >(lambda (stx) > (syntax-case stx () >[(_ path) > (printf "Importing: ~a~n" #'path) > (expand-import #'(file path))] > (require (my-file "test.rkt")) > ```

Re: [racket-users] "is not in my domain"

2020-06-01 Thread Ben Greenman
On 5/29/20, Beatriz Moreira wrote: > > > Hi, im a beginner with racket and im using it to implement a language in > order to test its operational semantic rules. > > This is the function where i keep having the error: > > (define-metafunction FS > > call : env-ß classes address f ((x v)...) -> e >

Re: [racket-users] Inference for polymorphic functions not supported?

2020-05-18 Thread Ben Greenman
On 5/18/20, Hendrik Boom wrote: > I keep getting the messages like > > Type Checker: Inference for polymorphic keyword functions not supported in: > (sort hash-list string (symbol->string (car p))) #:cache-keys? #t) The way to avoid guesswork here is `inst`: ((inst sort (Pair Symbol Natural) St

Re: [racket-users] Mysterious multiple values in a typed-racket program

2020-05-09 Thread Ben Greenman
On 5/9/20, Hendrik Boom wrote: > I get the message > > readspec.rkt:195:8: Type Checker: Expression should produce 3 values, but > produces 1 values of types String in: (for/set : (Setof String) (((l : > String) (cast (in-lines input-port) (Sequenceof String (cast > (string-trim l) String)) >

Re: [racket-users] Rhombus project plan

2020-04-30 Thread Ben Greenman
On 4/29/20, Sorawee Porncharoenwase wrote: > (Not directly related to Rhombus) Speaking of “how to contribute”, I find > that it is not friendly at all to setup stuff in order to contribute to > Racket core and main distribution. According to > https://blog.racket-lang.org/2017/09/tutorial-contrib

Re: [racket-users] Location grabbing in typed/rackunit

2020-04-28 Thread Ben Greenman
On 4/28/20, shane c wrote: > I think require/typed/provide in typed/rackunit is affecting the location > grabbing feature. Hoping someone can provide a suggested path forward. When > > I run this program, > > #lang typed/racket/base > > (require typed/rackunit) > (check-true (string (check-true (s

Re: [racket-users] Functions not being linked in scribble

2020-04-28 Thread Ben Greenman
On 4/28/20, David Storrs wrote: > According to what I see in Scribble, both actual examples and in the > documentation, I had thought that if I did @defproc[func-name] then > func-name would become a link target and later uses of @racket[func-name] > would automatically link to that site. I'm cle

Re: [racket-users] a question or two regarding Gregor

2020-04-27 Thread Ben Greenman
On 4/27/20, Tim Hanson wrote: > > I thought I'd check here: > - does this seem like a reasonable idea? > - is mine an unusual use case and most folks know what format to expect and > the exception approach is fine? I've written code like this before and used it in a contract. ``` (define (iso860

Re: [racket-users] Gradual Typed Racket?

2020-04-17 Thread Ben Greenman
On 4/17/20, Sorawee Porncharoenwase wrote: >> >> My understanding is that contract-out only provides protection against >> inappropriate calls from clients *outside* the module, whereas >> define/contract enforces the contract against everyone, including things >> inside the module. Do I have tha

Re: [racket-users] Gradual Typed Racket?

2020-04-17 Thread Ben Greenman
Hi Marc, >> For contracts, though, (provide (contract-out ...)) gives better error >> messages than define/contract. >> > > In what sense is this the case, and where can I read more about the > differences, as well as how to improve errors of contracts? contract-out gives better error messages t

Re: [racket-users] Unfinished S-Expressions in scribbled code blocks

2020-04-12 Thread Ben Greenman
> What is the proper way of typesetting (in scribble) parts of racket code > which do not form complete S-expression? The proper way is to make a #lang (in particular, a `read-syntax`) that deals with incomplete S-expressions. I don't know if anyone has done / attempted this. An improper way is

Re: [racket-users] typed mutable fields in structures.

2020-04-12 Thread Ben Greenman
Yes, that's right. I think TR could support this choice ... the typechecket (tc-structs.rkt) seems to know about the per-field mutability that comes from a struct info. On 4/11/20, Hendrik Boom wrote: > I noticed that in regular Racket, when defining a structure, it is > possible for each field

Re: [racket-users] Suggestions for "The Racket Guide"

2020-04-08 Thread Ben Greenman
On 4/8/20, Stephen De Gabrielle wrote: > That’s a good suggestion! Do you know the relevant JavaScript we can try it > out with. Might be an easy PR. > Beware that snippets are not always self-contained. A button should grab any requires and earlier code needed to make the example run. That'd be

Re: [racket-users] Scribble for literate dotfiles?

2020-04-07 Thread Ben Greenman
On 4/5/20, Karl Meakin wrote: > I want to write my dotfiles in literate programming style. As far as I can > > tell, everyone does this using Emac's org-mode. I'd rather use a > fully-fledged programming language (and not be tied to a particular > editor). Is it possible to achieve this using Scr

Re: [racket-users] Issue with define-type and typed classes

2020-03-31 Thread Ben Greenman
because the code sometimes compiles. 1. When I first tried `raco pkg install remap` (using a current CS), it worked 2. Then I tried compiling with BC 7.6 and CS 7.6. BC succeeded and CS failed. 3. Later, I saw 2 consecutive runs of CS fail and succeed: ``` (20:02)% rm -r compiled (20:02)% /Appli

Re: [racket-users] HTDP2e Exercise 342 find-all

2020-03-31 Thread Ben Greenman
On 3/21/20, Aron Zvi wrote: > Hi guys, > > Can I get a hint for Exercise 342 find-all > Don't use `find` as a helper function; instead, design a function that returns a list of successes -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsub

Re: [racket-users] HTDP2E 22.3 Domain-Specific Languages: Configurations

2020-03-31 Thread Ben Greenman
On 3/30/20, Aron Zvi wrote: > Hey guys > > In 22.3 Domain-Specific Languages: Configurations, the book introduces the > following data example and data definitions for FSM configurations > > > (define >

Re: [racket-users] Best way to handle different versions of Racket?

2020-03-30 Thread Ben Greenman
On 3/30/20, Siddhartha Kasivajhula wrote: > Hi there, > Is there a standard/recommended way to handle multiple versions of Racket > in library code? If you're planning to ship the library as a package, you can also: 1. make 2 versions of the library (maybe as two branches in the same git repo) 2

Re: [racket-users] Switch off type checking via typed/racket/no-check fails on typed big-bang

2020-03-30 Thread Ben Greenman
On 3/25/20, Marc Kaufmann wrote: > Hi, > > I am trying to switch off type checking on a file so that I can prototype > faster without the wait for the type checker. However, my code also uses > typed/2htdp/universe and typed/2htdp/image, and I get an error on > `big-bang`: > >> Type Checker: Macro

Re: [racket-users] Reflecting on context arity

2020-03-27 Thread Ben Greenman
procedure-result-arity is very limited if you can find a way to call `f` once, though, you could assume that its result arity never changes -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails

Re: [racket-users] TR: Occurrence Typing with custom predicate

2020-03-24 Thread Ben Greenman
On 3/24/20, mmcdan wrote: > Hello, > > I'm trying to use occurrence typing for (Vectorof Symbol) or (Boxof > Symbol). > > Creating a custom predicate for (Listof Symbol) seems to work: > --- > #lang typed/racket > > (: los? (-> Any Boolean : (Listof Symbol))) > (define los? > (lambda (seq) (and

Re: [racket-users] Contracts on parameters

2020-03-23 Thread Ben Greenman
On 3/23/20, David Storrs wrote: > (define/contract (foo x) > (-> boolean? any) > 'ok) > > (foo #t) > 'ok > (foo 7) > ; foo: contract violation > ; expected: boolean? > ; given: 7 > ; in: the 1st argument of > ; (-> boolean? any) > ; contract from: (function foo) > ; blaming: to

Re: [racket-users] Gradual Typed Racket?

2020-03-23 Thread Ben Greenman
On 3/21/20, unlimitedscolobb wrote: > Hello, > > I come to Racket from Haskell and so far I am quite happy, as I feel freer > to do some weird stuff from time to time, and I am absolutely in love with > the Lisp-parens syntax. > > As a former Haskeller, one of the first things I tried was Typed Ra

Re: [racket-users] trace facility in Racket?

2020-03-21 Thread Ben Greenman
On 3/21/20, dgtlcmo wrote: > Does anyone know how to trace functions inside a closure? I would like to > trace hanoi-move, however find that with MIT Scheme I need to place (trace) > > within the closure (hanoi n), otherwise the trace will not occur. > > Can a trace like this be performed in Rack

Re: [racket-users] Load and execute files

2020-03-20 Thread Ben Greenman
On 3/20/20, Alexandre Rademaker wrote: > > It works! Thank you. The B.rkt (or check.rkt in my last message) can’t have > the `#lang racket` line. I am still confused about the implications of the > `#lang racket` line in the file and the module system of Racket. Great! In this case, adding #lang

Re: [racket-users] Re: HTDP2e part 4: 20.3 Refining Functions dir.rkt

2020-03-20 Thread Ben Greenman
On 3/20/20, Aron Zvi wrote: > Thanks for your reply Ben. > > I understand that I am supposed to be getting a Dir instance. > My confusion is indeed regarding the value of the name field of Dir for > which I get a (full) path symbol of the directory and not just the folder > name

Re: [racket-users] Load and execute files

2020-03-20 Thread Ben Greenman
trying to avoid the necessity of adding the > (require …) commands in the check.rkt so I can select the student files to > test in the command line. The -r or -f option cause the same error. The > (provide …) forms are presented in the ex* files. > > Best, > Alexandre > > >

Re: [racket-users] Load and execute files

2020-03-19 Thread Ben Greenman
> But I was really expecting that the option -t in the racket command should > replace the explicit (require…) in B.rkt. Something like > >> racket -t A.rkt -f B.rkt > default-load-handler: expected a `module' declaration, but found something > else Yes that almost works, but A.rkt needs to provid

Re: [racket-users] Load and execute files

2020-03-19 Thread Ben Greenman
On 3/19/20, Alexandre Rademaker wrote: > > Suppose I have some functions defined in a file A.rkt and some tests defined > in the file B.rkt. How can I execute the tests in the command line? > > I was expecting to be able to run > >> racket A.rkt B.rkt > > But this does not evaluate the expressions

Re: [racket-users] HTDP2e part 4: 20.3 Refining Functions dir.rkt

2020-03-19 Thread Ben Greenman
On 3/19/20, Aron Zvi wrote: > Hey guys, > > In part 4 section 20.3 Refining Functions I am using (require htdp/dir) > and (create-dir DIR-PATH). I get back a Dir instance with name value being > a full path symbol of the folder. ie. (make-dir > '/Users/SSS/Documents/xyz empty empty). > This does n

Re: [racket-users] Logger shows lots of info messages about collapsible-contract-bailout and collapsible-value-bailout

2020-03-14 Thread Ben Greenman
>> I don't know what triggers it and google does not return any results. >> Just curious, is it something I should be worried about? >> I am using Racket v7.5 if it helps. Searching google for "collapsible contract" should point to these pages, at least: https://docs.racket-lang.org/reference/col

Re: [racket-users] HTDP2e Exercise 320 help

2020-03-12 Thread Ben Greenman
Those data definitions seem to match what the exercise is asking for. But I think the second one is not what the exercise intends because there are some data examples that match the 2nd definition but not the 1st. My guess is that "integrate the definition of SL" means something less drastic than

Re: [racket-users] TR dependent types cannot check equality of symbols

2020-02-24 Thread Ben Greenman
On 2/24/20, Marc Kaufmann wrote: > Very nice, adding > > (: get-user-var (case-> ...)) > > indeed does the trick. So I can use `case->` to do overloading (if that's > what it is called), by defining different functions for different type > signatures, and then put them together into a single funct

Re: [racket-users] TR dependent types cannot check equality of symbols

2020-02-23 Thread Ben Greenman
Try this case-> type instead: (case-> (-> Integer 'name Symbol) (-> Integer 'age Integer) (-> Integer Symbol (U Symbol Integer))) I don't know what it would take to add refinements for symbols, but that might be useful. Andrew Kent's dissertation may have some pointers: https://pn

Re: [racket-users] How do I just run the type checker?

2020-02-21 Thread Ben Greenman
On 2/21/20, 'David Florness' via Racket Users wrote: > Sam Tobin-Hochstadt writes: > >> If you compile the file with `raco make server.rkt` then it will run >> the type checker as part of compilation. Furthermore, it will run >> faster the next time since it won't have to re-compile. > > Question

Re: [racket-users] Typed Racket: Casting to types containing type variables

2020-02-19 Thread Ben Greenman
On 2/19/20, unlimitedscolobb wrote: > > [] > > ;Type Checker: Type a could not be converted to a contract because it > contains free variables. > ; in: a > > Does this mean that I can never cast to types containing type variables? Yes > My original problem comes from playing around with ev

Re: [racket-users] Typed code from untyped code

2020-02-17 Thread Ben Greenman
On 2/17/20, Bertrand Augereau wrote: > Hello and thank you Ben for the explanation, > > I had already implemented the workaround, I'll keep it :) > It seems that wrapping every binding access in a function is seen as > unnecessary in Scheme and Common Lisp ("Reference

Re: [racket-users] Typed code from untyped code

2020-02-17 Thread Ben Greenman
If you export a "getter" function instead of the list, both modules have the same behavior: ``` #lang racket/base (module racket_mod racket (provide (struct-out s)) (provide get-s) (provide set-list-of-s!) (struct s (a)) (define list-of-s '()) (define (get-s) list-of-s) (define (se

Re: [racket-users] TR: cast on mutable hash table...

2020-02-14 Thread Ben Greenman
On 2/14/20, 'John Clements' via users-redirect wrote: > I think I may understand what’s going on here, but a student and I worked on > this for quite a while today before I found the problem. > > > > In this case, one easy error is to change the ‘cast’ into an ‘ann’, which > works fine. You

Re: [racket-users] How to convert String to Integer

2020-02-11 Thread Ben Greenman
You may want `exact-integer?` -- 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

Re: [racket-users] How to use dates (especially gregor) with Typed Racket?

2019-12-11 Thread Ben Greenman
Thanks for the feedback! I opened a pull request for the docs: https://github.com/racket/typed-racket/pull/886 Happy to continue the discussion over there. (The example I added to the guide is maybe too simple.) -- You received this message because you are subscribed to the Google Groups "Rack

Re: [racket-users] How to use dates (especially gregor) with Typed Racket?

2019-12-07 Thread Ben Greenman
On 12/7/19, Marc Kaufmann wrote: > Thanks Ben and Jon, that did the trick. > > I realized when following the code that the structure wasn't exported - but > > I didn't know how to work around that. I now also checked the > documentation, and the only thing I foun

Re: [racket-users] How to use dates (especially gregor) with Typed Racket?

2019-12-03 Thread Ben Greenman
The error is because gregor/time doesn't export a struct. But nevermind that, because you're probably best off with an opaque type: ``` #lang typed/racket (require/typed gregor/time [#:opaque Time time?] [time (->* [Integer] [Integer Integer Integer] Time)] [time->iso8601 (-> Time String)])

Re: [racket-users] contract for an "overloaded function"

2019-11-29 Thread Ben Greenman
Try ->i. I wouldn't worry about performance until makes itself a problem. On 11/29/19, Ryan Kramer wrote: > Thanks, but I don't think `case->` works for me. It looks like it chooses a > > case purely based on the number of arguments. The following example, when > given two arguments, will always

Re: [racket-users] Typed Racket needs annotation to realize (Mutable-HashTable Symbol Symbol) is of a more general type

2019-11-06 Thread Ben Greenman
On 11/6/19, Marc Kaufmann wrote: > I assumed it was something to do with mutability, but I don't understand > what you mean when you say there is a two-way channel. The reference in > typed racket ( > https://docs.racket-lang.org/ts-reference/type-ref.html#%28form._%28%28lib._typed-racket%2Fbase-e

Re: [racket-users] Re: [standard-fish] Summer competiton 2019

2019-10-25 Thread Ben Greenman
On 8/17/19, Philip McGrath wrote: > This contest is a bright idea, so here's a standard lightbulb: > [image: default-lightbulb.png] > The code is at > https://gist.github.com/LiberalArtist/4d0059f5af23043515a3cc74bd4928c2 > > -Philip I used standard-lightbulb in a slideshow [1]. Thank you Phil f

Re: [racket-users] Is there a trick to know which types to specify when importing untyped racket into typed racket?

2019-10-06 Thread Ben Greenman
On 10/6/19, Raoul Schorer wrote: > Hi, > > I would very much like to import the package multimethod > > > into a typed module. Unfortunately, the symbols exported by this module are > > non-

Re: [racket-users] Fwd: Re: Racket code query

2019-10-03 Thread Ben Greenman
I opened a pull request with a suggestion https://github.com/conniepocky/Waffle-Lang/pull/1 On 10/3/19, Stephen De Gabrielle wrote: > Hi > > Please see the thread below for a query from Connie who is trying to make > her own language (11yo?!) > > I believe this is her code; > https://github.com/c

  1   2   3   4   >