Re: [racket-users] Re: Macro behaves differently when run from different modules

2019-09-28 Thread Ben Greenman
On 9/28/19, Jonathan Simpson wrote: > It works when I change my mag-line syntax class to: > > (define-syntax-class mag-line > (pattern (line expr ...))) > > So removing the literal specifier on line seems to work. I'm still not sure > why the two modules behave differently though. It seemed

Re: [racket-users] scribble/srcdoc raised exception fix and class-doc syntax form

2019-09-25 Thread Ben Greenman
> Should I include a brief documentation in > scribble-doc/scribblings/scribble/srcdoc.scrbl within the same PR as well? Yes! And if there are tests for scribble/srcdoc, it'd be good to add some for `class-doc` before merging -- You received this message because you are subscribed to the

Re: [racket-users] scribble/srcdoc raised exception fix and class-doc syntax form

2019-09-25 Thread Ben Greenman
These changes look great. Can you open a pull request for the racket/scribble repo? https://github.com/racket/scribble Some comments below > Also I implemented a simple defclass wrapper as a provide form named > class-doc: > > class-doc syntax form > (define-provide/doc-transformer

Re: [racket-users] transparency of structs?

2019-09-07 Thread Ben Greenman
I see the same results on Racket 7.0 and 6.5, so I don't think anything has changed. Maybe the trouble is that (make-inspector) makes a subinspector of (current-inspector), which has the same value for both the main module & the submodules. Switching to (make-sibling-inspector) causes (struct?

Re: [racket-users] Borders in pict

2019-09-02 Thread Ben Greenman
Inside Welcome to Racket v7.4.0.1. > (require pict) > (pict-width (rectangle 100 100 #:border-width 5)) 100 > (pict-height (rectangle 100 100 #:border-width 5)) 100 -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group

Re: [racket-users] [racket users] Contracts and make-keyword-procedure question

2019-08-24 Thread Ben Greenman
The -> combinator doesn't support unspecified keywords. ->* won't work either. Instead, you can try writing a new contract combinator (keyword-procedure/c ?) Or, don't use define/contract and put the domain checks in the function body. -- You received this message because you are subscribed to

Re: [racket-users] Seeking good benchmark code for immutable hash and hash set usage

2019-08-21 Thread Ben Greenman
A few of the GTP benchmarks [1] use immutable hashes. Here's a link with the ones that look most interesting: http://ccs.neu.edu/home/types/tmp/gtp-hash.tar.gz And here's a small (untyped) program that uses code from the tr-pfds library to make a trie:

Re: [racket-users] Splicing the result of one macro into another

2019-08-20 Thread Ben Greenman
On 8/20/19, Brian Adkins wrote: > Consider the following two macros: > > (require (for-syntax syntax/parse)) > > (define-syntax (phone-numbers stx) > (syntax-parse stx > [(_ ((~literal number) phone) ...) > #'(list phone ...)])) > > (define x (phone-numbers >(number "1212")

Re: [racket-users] SOLVED: Calling function with Scribble text as argument(s)

2019-07-31 Thread Ben Greenman
>> At the beginning of every inclided file (and there are more than fifty >> of them) I have to place the lines >> >> #lang scribble/base >> @(require "pfx.scrbl") >> >> where pfx.scrbl contains the definitions of my new @ commands. You could replace those lines with a custom #lang:

Re: [racket-users] Calling function with Scribble text as argument(s)

2019-07-30 Thread Ben Greenman
> Now for the next problem. If I @include-section, an occurrence of > redtext in the included section is recognised as an unbound identifier. > Evidently I need to say something to get included sections to inherit > bindings fro the main file. `include-section` is much closer to Racket's

Re: [racket-users] tail-nesting recursive syntax

2019-07-24 Thread Ben Greenman
On 7/24/19, Mike G. wrote: >> My proposal is to pick a currently underused character (I picked '/' 30 >> years ago but amost anything would do) and use it to replace the >> tail-nesting '(', and remove its corresponding ')'. >> >> Suddenly visual parenthesis-matching becomes an order of magnitude

Re: [racket-users] Scribble reinstallation

2019-07-22 Thread Ben Greenman
You should be able to keep the current Racket, download a snapshot build, and run the `/bin/drracket` inside the snapshot https://www.cs.utah.edu/plt/snapshots/ -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group

Re: [racket-users] using scribble for everything from category theory to poetry

2019-07-16 Thread Ben Greenman
More answers: On 7/15/19, Hendrik Boom wrote: > (1) How does scribble handle mathematical notation? Presumably there's a > hack > for when I'm generating TeX, but is there anything reasonable when > generating > HTML? Mathjax is somewhat tolerable, but mathML would be nice. For TeX, I tell

Re: [racket-users] Seeking users to try file monitoring package

2019-07-10 Thread Ben Greenman
> I'm particularly curious if the (robust-watch) procedure provided by the > package in particular behaves consistently across operating systems. I do > not have a Mac and was hoping that a Mac+Racket user would be willing to try > this out and report his or her experience. (robust-watch) worked

Re: [racket-users] Trouble documenting a form with Scribble

2019-06-26 Thread Ben Greenman
Here's a small package that gets the link right (attached). If the example doesn't help, can you share your code? -- 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

Re: [racket-users] Re: Request for Feedback (SQL, Plisqin)

2019-06-22 Thread Ben Greenman
I don't know if I understood the "Aggregates are self-contained" section. The SQL looks self-contained, as long as you read the whole query. And one has to read the whole query in the Plisquin version too (but definitions come first). In the last section, I'm not sure what a "scalar" or "plural

Re: [racket-users] Relative Pathname problem

2019-06-22 Thread Ben Greenman
I tried to reproduce this problem, but wasn't able to. Which version of Racket are you using? How did you run the program? On 6/20/19, Amir Teymuri wrote: > I have the following situation: > > mylibrary: > >-src > - font.rkt > - gui.rkt >- scratch.rkt > > > So the src/

Re: [racket-users] Why struct type doesn't include field names?

2019-06-15 Thread Ben Greenman
On 6/15/19, Sorawee Porncharoenwase wrote: > First of all, . won’t work in standard Racket because . has a special > meaning (see > https://docs.racket-lang.org/reference/reader.html#%28part._parse-pair%29). The `read-cdot` parameter can change the standard meaning

Re: [racket-users] The search for routy

2019-06-14 Thread Ben Greenman
On 6/14/19, Gregor Kopp wrote: > Hi! > I found here docs: https://docs.racket-lang.org/routy/ > I'd like to try this for fast prototyping, but can't find the package as my > > google-fu is sloppy I guess. > Any help please, sirs and madams? Another option: search for "routy" at

Re: [racket-users] Scribble cannot use include-section when developing package library

2019-06-08 Thread Ben Greenman
In the separate files, try: @defmodule[simple-svg #:link-target? #f] -- 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

Re: [racket-users] Mutating hash-map while iterating

2019-06-03 Thread Ben Greenman
You want the paragraph just above the caveat about concurrent modification: > A hash table can be used as a two-valued sequence (see Sequences). The keys > and values of the hash table serve as elements of the sequence (i.e., each > element is a key and its associated value). If a mapping is

Re: [racket-users] Help: How to check a typed/racket type in an untyped Racket contract?

2019-05-17 Thread Ben Greenman
What happens if you provide the data structure from Typed Racket and require it in an untyped module? On 5/17/19, bruno cuconato wrote: > hi, > > I'm trying to use a data structure defined in a typed racket module in my > untyped code. > > I'm want it to be accessible from a generic interface,

Re: [racket-users] escape ~ in scribble's bib-entry

2019-05-03 Thread Ben Greenman
It's definitely a TeX issue. Leif Andersen and I were able to reproduce the error (thanks Leif!). Then we ran `scribble --latex test.scrbl` to make a .tex file and `pdflatex test.tex` for a nicer error message. The message gives a hint that the texlive `scheme-basic` is not enough: ``` cannot

Re: [racket-users] escape ~ in scribble's bib-entry

2019-05-01 Thread Ben Greenman
What version of Racket are you using? The file makes a pdf for me on v7.0 (and the current master) -- 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

Re: [racket-users] finding the package that a function is defined in

2019-04-26 Thread Ben Greenman
I normally: - search the docs, - find the identifier in the left column, - and read the libraries from the right column https://docs.racket-lang.org/search/index.html?q=contract-out -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To

Re: [racket-users] Defeating Racket’s separate compilation guarantee

2019-04-21 Thread Ben Greenman
One quick thought: I wasn't sure what to expect after reading the current title. How about changing it to say more about the specific exploit? "A terrible hack to move state across Racket phases" "How to smuggle state across phase boundaries" At least, it would have helped me if "separate

Re: [racket-users] From HtDP to Racket

2019-04-20 Thread Ben Greenman
On 4/20/19, Hendrik Boom wrote: > On Thu, Apr 18, 2019 at 09:08:07AM -0700, Luis Sanjuán wrote: >> Then I thought about another non-Racket languages that no one >> mention, if I recall well, for which such examples would be more than >> helpful, *SL languages ;) > > What are *SL languages? Those

Re: [racket-users] Is there a way to find where some feature is implemented in racket?

2019-04-17 Thread Ben Greenman
> Also, wait, all it took to define s-exp meta language ... was one line?! > You racketeers need to get serious here, no wonder you can't find jobs. If > you don't create work for yourself noone would. Go build 80% frameworks or > smth You might like gnal-lang:

Re: [racket-users] Re: raco setup conflicting with slideshow

2019-04-08 Thread Ben Greenman
On 4/8/19, Ben Greenman wrote: > I think you want to require slideshow/base instead > Nevermind, that's not right --- at least not on Mac OS where its not possible to instantiate racket/gui in a non-main place. The problem is that requiring slideshow ends up starting the GUI and (I

Re: [racket-users] Re: raco setup conflicting with slideshow

2019-04-08 Thread Ben Greenman
I think you want to require slideshow/base instead -- 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. For more options,

Re: [racket-users] Pattern: reusing the same name in macro-generated definitions

2019-04-04 Thread Ben Greenman
Racket's macros are hygienic. They'll gensym for you. -- 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. For more

Re: [racket-users] Error handling for the GUI

2019-03-23 Thread Ben Greenman
On 3/23/19, David Storrs wrote: > Alex makes good points, but I'm curious about the original question: Is > there a straightforward way to tell which function it was whose contract > was violated, aside from parsing the message? Or, more generally, where a > specific exception came from? For

Re: [racket-users] color-maps for the plot package

2019-03-19 Thread Ben Greenman
On 3/19/19, Justin Zamora wrote: > On Tue, Mar 19, 2019 at 10:35 PM Ben Greenman > wrote: >> I'm thinking a color-map% object would define a possibly-infinite >> sequence of colors that look nice in some way. The colors might be >> useful anywhere where someone wan

Re: [racket-users] color-maps for the plot package

2019-03-19 Thread Ben Greenman
> Could you (or Ben or Matt) elaborate on how do you see this work for non > plot programs? > > For plots, the reason that color maps are useful is because the user will > usually not care what the colors are, as long as they stand out visually > and look pleasing next to each o

Re: [racket-users] color-maps for the plot package

2019-03-19 Thread Ben Greenman
+1 Maybe the colormaps should go in racket/draw. -- 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. For more options,

Re: [racket-users] out of memory with streams

2019-03-12 Thread Ben Greenman
You can also use sequences: #lang racket/base (require racket/sequence) (sequence-ref (in-producer (let ([i 0]) (lambda () (begin0 i (set! i (+ i 1)) 2000) (sequence-ref (in-naturals) 2000) -- You received this message because you are subscribed to the

Re: [racket-users] Re: What is the best way to "raco make" all *.rkt files in a directory tree?

2019-03-11 Thread Ben Greenman
On 3/11/19, 'John Clements' via Racket Users wrote: > I would suggest maybe just using racket here: > > #lang racket > > (require setup/parallel-build) > > (define racket-files > (for/list ([file (in-directory "/tmp")] > #:when (regexp-match #px"\\.rkt$" file)) > file)) > >

Re: [racket-users] How to fix typos in documentation?

2019-03-08 Thread Ben Greenman
On 3/8/19, David Storrs wrote: > On Fri, Mar 8, 2019 at 3:13 PM Greg Hendershott > wrote: > >> I have a dumb question. Why can't doc pages have links whose label is >> something like "Want to improve the docs?", and the URL goes directly >> to the appropriate .scrbl file on GitHub? >> > > I

Re: [racket-users] [racket users] Struct property question

2019-03-01 Thread Ben Greenman
prop:procedure is indeed pre-defined: https://docs.racket-lang.org/reference/procedures.html#(def._((lib._racket%2Fprivate%2Fbase..rkt)._prop~3aprocedure)) Here's one way to look at things: - struct is a tool for making new datatypes - #:property is a hook for adding a new "skill" to the new

Re: [racket-users] how to use union types

2019-02-28 Thread Ben Greenman
On 2/28/19, Brian Craft wrote: > So, when working with large data that is internal to an app, where schema > is guaranteed by serialization, there's no way to load that without another > O(N) pass to satisfy the type checker? Right. This is how the type checker helps find & prevent bugs.

Re: [racket-users] Scribble wraps @verbatim? Also, comments on Scribble

2019-02-27 Thread Ben Greenman
> It bothers me that the change applies only to HTML output and not PDF > output via LaTeX, but I don't see a way to get that effect via LaTeX > without substantial changes. Is it possible to wrap each line in an \mbox, or to have SVerbatim make the \textwidth extremely wide? -- You received

Re: [racket-users] Cannot use case+else inside match+else

2019-02-25 Thread Ben Greenman
Here's a suggestion for the docs: https://github.com/racket/racket/pull/2505 -- 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

Re: [racket-users] side by side; scribble

2019-02-04 Thread Ben Greenman
It's possible to have both, but not always easy. Best-case scenario: make CSS classes named `TwoColumn` and `multicolsbreak` that work the same as the LaTeX macros. Otherwise, the Scribble file will need to produce differently-structured output for HTML and LaTeX. Sometimes it helps to run

Re: [racket-users] side by side; scribble

2019-02-04 Thread Ben Greenman
No need to apologize. The point of the example files was to show how to connect a Scribble function to a LaTeX macro. I don't recommend copy-pasting the files. Instead: 0. Make a small Scribble document to render a pdf without the side-by-side text. (Scribble's "Getting Started" guide should

Re: [racket-users] side by side; scribble

2019-02-04 Thread Ben Greenman
I'm not sure what to simplify. Can you send what you tried, and explain what happened and what you expected? -- 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

Re: [racket-users] side by side; scribble

2019-01-30 Thread Ben Greenman
In case you have trouble navigating the docs, here's a related example. First, a Scribble function that generates output with a Scribble style named "TwoColumn": https://github.com/nuprl/tag-sound/blob/master/gf-icfp-2018/main.rkt#L326 Second, a LaTeX macro named "TwoColumn" that formats the

Re: [racket-users] Github collection for making a language

2019-01-24 Thread Ben Greenman
> I think beautiful racket, and fear-of-macros are essential, but I feel I > lack resources for > > - Creating other styles of syntax: e.g. c/java, python, ruby, > smalltalk, forth, etc. > > - A video with a good quality image > > - IDE(DrRacket) support for new language

Re: [racket-users] Getting errors running PLT-Redex book example

2019-01-12 Thread Ben Greenman
You discovered a backwards incompatible change to Redex. Changing M and N to A and B is a good fix. (The errata really should talk about this.) Here are two related threads: https://groups.google.com/d/msg/racket-users/be54SG881GU/bndA4eiGAQAJ

Re: [racket-users] Functions in a terminal port

2019-01-02 Thread Ben Greenman
Maybe use `port-count-lines!` and `port-next-location` ? http://docs.racket-lang.org/reference/linecol.html -- 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

Re: [racket-users] Racket 5, multiple-collection packages and info.rkt

2018-12-12 Thread Ben Greenman
Another option - make a branch for the Racket 5 code - add version exceptions [1] to pkgs.racket-lang.org - split the repo on the master branch The downside to this plan is that someone needs to add a version exception for every 5.x version of Racket that `graph` wants to support. [1]

Re: [racket-users] plot legends

2018-12-01 Thread Ben Greenman
I think this requires discussion & modification. E.g.: https://github.com/racket/plot/issues/49 -- 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

Re: [racket-users] Racket Document Translation

2018-12-01 Thread Ben Greenman
There's a Chinese translation in progress: https://github.com/racket/racket/issues/1902 -- 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

Re: [racket-users] add set-subset?

2018-10-05 Thread Ben Greenman
Yes, @index I learned about it to put "powerset" to the docs, and always go back to that example when something like this comes up: https://github.com/racket/racket/blob/master/pkgs/racket-doc/scribblings/reference/pairs.scrbl#L1333 -- You received this message because you are subscribed to the

Re: [racket-users] add set-subset?

2018-10-04 Thread Ben Greenman
How about a pull request that redirects searches for "set-subset?" to the `subset?` function? -- 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

Re: [racket-users] Performance for structs across typed–untyped boundaries

2018-09-17 Thread Ben Greenman
Your program is half an answer :) Here's a second half to compare: #lang racket/base (module typed1 typed/racket/base (provide (struct-out container) container-append) (define-type SymbolTree (U Null Symbol (Pairof SymbolTree SymbolTree))) (struct container ([tree :

Re: [racket-users] From Clojure to Racket

2018-08-31 Thread Ben Greenman
+1, especially for the at-exp post -- 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. For more options, visit

Re: [racket-users] From Clojure to Racket

2018-08-31 Thread Ben Kovitz
ul for ordinary Racket programming, not just for Scribble. So *that's* how you do string interpolation! And when looking through the documentation, I had skipped right over ~a function, which looks like another bread-and-butter function. https://www.greghendershott.com/2015/08/at-expressions.html

Re: [racket-users] From Clojure to Racket

2018-08-24 Thread Ben Greenman
The Racket Cheat Sheet might help: http://docs.racket-lang.org/racket-cheat/index.html -- 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

Re: [racket-users] From Clojure to Racket

2018-08-24 Thread Ben Kovitz
t I realize that this may be asking more than is feasible. However, I am willing to help write one in collaboration with someone who already knows their way around Racket. The best time to write such a thing is while beginning—when the stuff that goes without saying because everyone knows it is

Re: [racket-users] From Clojure to Racket

2018-08-24 Thread Ben Kovitz
n six months of beating your head against a new language completely on your own. (I'd prefer not to go the latter route.) 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, se

Re: [racket-users] From Clojure to Racket

2018-08-24 Thread Ben Kovitz
: very simple stuff that's crucial to know to be productive and usually takes only a couple minutes to explain in person but is omitted in documentation. I take it, then, that no collection of these little things exists yet? Ben -- You received this message because you are subscribed to the Google G

[racket-users] From Clojure to Racket

2018-08-23 Thread Ben Kovitz
eoretical. I just want to find out some basics about how you actually get things done in Racket, explained briefly for someone with prior experience with Clojure. Ben -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe fr

Re: [racket-users] inspecting inferred types in typed racket

2018-08-09 Thread Ben Greenman
Typed Racket first runs the macro expander, and then type checks the expanded program. If your implementation can type check an expanded program too, then you can probably get started by copy/pasting typed racket's #%module-begin and inserting a new pass over the program just after the optimizer.

Re: [racket-users] inspecting inferred types in typed racket

2018-08-09 Thread Ben Greenman
I don't think so, but check `typed-racket/types/type-table`: https://github.com/racket/typed-racket/blob/master/typed-racket-lib/typed-racket/types/type-table.rkt#L20 -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this

Re: [racket-users] Re: Recommendation for learning syntax?

2018-08-07 Thread Ben Greenman
Hope this helps with syntax-parse: http://docs.racket-lang.org/syntax-parse-example/index.html If not, please submit an issue! -- 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,

Re: [racket-users] difficult to package library

2018-08-01 Thread Ben Greenman
> I want to package my library for https://pkgs.racket-lang.org but I can't > figure out how to do the info.rkt file. > > I would like my repo to be like this: > > * repo/peg/codehere.rkt like main.rkt peg.rkt etc. > * repo/tests/ my tests > * repo/scribblings/peg.scrbl the documentation > > is

Re: [racket-users] what do people use for number formatting?

2018-05-07 Thread Ben Greenman
I use this: http://docs.racket-lang.org/gtp-util/index.html#%28def._%28%28lib._gtp-util%2Fmain..rkt%29._rnd%29%29 I didn't know about SRFI 54 --- looking forward to reading other responses. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To

Re: [racket-users] in-src documentation: why not?

2018-02-20 Thread Ben Greenman
file/gif is from the draw-lib package https://github.com/racket/draw/blob/master/draw-lib/file/gif.rkt -- 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

Re: [racket-users] Typed Racket and performance impact

2018-02-19 Thread Ben Greenman
Hi Paulo, I hope you try using Typed Racket. If the performance turns out to be a problem, we can try to help. Here are some other experiences that people have shared on the list: https://groups.google.com/d/msg/racket-users/rfM6koVbOS8/klVzjKJ9BgAJ

Re: [racket-users] documentation and tests not running on racket pkgs

2018-02-09 Thread Ben Greenman
I'm having a similar problem with the documentation for this package: https://pkgd.racket-lang.org/pkgn/package/gtp-measure On Fri, Feb 9, 2018 at 12:11 PM, wrote: > Hello, > > I uploaded my package 3 days ago https://pkgs.racket-lang.org/package/peg > but the documentation

Re: [racket-users] Is there a clear 'HOWTO' for writing/posting packages?

2018-02-07 Thread Ben Greenman
Here are 2 how-tos on creating a package: http://blog.racket-lang.org/2017/10/tutorial-creating-a-package.html https://beautifulracket.com/jsonic-3/the-info.rkt-file.html The error message might be because your repo doesn't have an `info.rkt` file.

Re: [racket-users] (number->string -nan.0) == "+nan.0" ?

2018-02-06 Thread ben rudgers
gest in light of your comments), it may also be a symptom of most widely used programming languages having a linguistic heritage aligned with English. Caveat that my remark was regarding the literature of programming rather than mathematics. Cheers. Ben On Tue, Feb 6, 2018 at 7:07 AM, Nor

Re: [racket-users] (number->string -nan.0) == "+nan.0" ?

2018-02-05 Thread Ben Greenman
Looks like its for the same reason that (number->string -0) yields "0". +nan.0 is special, but -nan.0 is the same as (- +nan.0) http://docs.racket-lang.org/reference/numbers.html On Mon, Feb 5, 2018 at 6:41 PM, David Storrs wrote: > I noticed that (number->string

Re: [racket-users] Re: OSX racket install problem - "sudo racket" works, but running as a user fails...

2018-01-22 Thread Ben Greenman
The issue was with environment variables. The user account had some PLT variable set. Running as root un-set the variables that were causing the trouble. On Mon, Jan 22, 2018 at 11:51 AM, Robert X wrote: > I install on MacOS using the .dmg download. I put it in /Users//Racket

Re: [racket-users] Can't update scribble-lib with raco

2017-12-11 Thread Ben Greenman
> What's the best way around this? Install Racket v6.11. Then `raco pkg install plai-typed` should just work. > Why isn't raco finding the appropriate versions? When raco installed plai-typed, it (1) saw that plai-typed was not installed and (2) searched on pkgs.racket-lang.org and (3)

Re: [racket-users] match in Lazy Racket?

2017-12-08 Thread Ben Greenman
You can `(require racket/match)`. Make sure to force the match expression! #lang lazy (require racket/match) (match (! (string->symbol "a")) ['a 'a] ['b 'b]) -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group

Re: [racket-users] Typed Racket has lowered my performance

2017-12-02 Thread Ben Greenman
> This has tanked my performance to the point where the tests for > non-scalar types (vectors and hashes) time out on the package > server, and thus fail. > https://gitlab.com/HiPhish/MsgPack.rkt/commit/0b6cdc7115389db97a8de2a5175c1feb4c939f8f The performance is probably because HashTable and

Re: [racket-users] Raising arbitrary errors in Typed Racket

2017-12-02 Thread Ben Greenman
Oh right --- instead of making a new exception type, it's possible to use `require/typed` to give `raise` a different type signature: ``` #lang typed/racket/base (require/typed racket/base (raise (All (A) (-> Any A (with-handlers ((vector? values)) (raise (vector 1 2 3))) ;; '#(1 2 3)

Re: [racket-users] Advantage of ->d over ->i

2017-12-01 Thread Ben Greenman
Let me make sure I understand: 1. A converter is like a two-way function, lets say (A . <-> . B) 2. If someone composes two incompatible converters, like (integer? . <-> . symbol?) and (string? . <-> . boolean?) then they should get an error that points to the place where they tried to do the

Re: [racket-users] Raising arbitrary errors in Typed Racket

2017-12-01 Thread Ben Greenman
That name sounds good to me. -- 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. For more options, visit

Re: [racket-users] Raising arbitrary errors in Typed Racket

2017-12-01 Thread Ben Greenman
The error is because type signature of `raise` doesn't allow "non-flat" values like functions and mutable vectors. It might not be safe to allow `(raise (vector 1 2 3))` in Typed Racket ... I'm not sure. For now I think you should make a new exception type. Example: ``` #lang typed/racket/base

Re: [racket-users] Include Documentation from a scribble/lp2 File: "identifier `doc' not included [...]" Error

2017-11-29 Thread Ben Greenman
> * Would have never been able to deduce this from the info you referenced... Good point. Here's a pull request for changing the docs: https://github.com/racket/scribble/pull/154 -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe

Re: [racket-users] Include Documentation from a scribble/lp2 File: "identifier `doc' not included [...]" Error

2017-11-29 Thread Ben Greenman
Try changing the include-section to import the `doc` submodule: @include-section[(submod "sub-scribble.rkt" doc) I got this idea from the 2nd paragraph of the "scribble/lp2 language" docs: http://docs.racket-lang.org/scribble/lp.html#%28mod-path._scribble%2Flp2%29 On Wed, Nov 29, 2017 at 7:15

Re: [racket-users] Plot - Choosing the number of mesh lines independently from the number of samples

2017-11-29 Thread Ben Greenman
I don't think this is currently possible. To implement this, I think the `for-2d-sample` loop here needs to change: https://github.com/racket/plot/blob/master/plot-lib/plot/private/plot3d/surface.rkt#L28 (I guess there should be 2 loops, one to draw the surface and one to draw the lines) On

[racket-users] or/c, parametric->/c, and contract-first-order-passes?

2017-11-28 Thread Ben Greenman
The other day, I wanted to write a contract for a function that takes any kind of vector and does something depending on whether the vector is mutable. The contract was basically the one below: ``` #lang racket (define/contract (f v) (parametric->/c [A] (-> (or/c (vectorof A #:immutable

Re: [racket-users] misterious empty line

2017-11-26 Thread Ben Greenman
My guess is that "(define" does something special to figure out where to insert newlines in the rendered document. On Thu, Nov 23, 2017 at 9:13 AM, Jos Koot wrote: > My code: > > #lang scribble/manual > > @(require > scribble/core > scribble/eval > racket >

Re: [racket-users] Interaction of Typed Racket with define/match?

2017-11-17 Thread Ben Greenman
> Others: Does define/match do anything that would make Typed Racket see it > differently from define + match*? It seems like define/match expands to > define + match*/derived anyway. The only thing that's different is which > define it's expanding to. So is expanding to Racket's define instead of

Re: [racket-users] DrR compilation progress bar

2017-10-28 Thread Ben Greenman
I like the output `raco make -v ` gives on the command-line. How about piping that into the interactions window? -- 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

Re: [racket-users] European Racketeers and conferences

2017-10-17 Thread Ben Greenman
I just changed the map settings so anyone can edit it. If you'd like to add your city to the map: 1. Look for "racketeers.csv" in the menu 2. Click the "vertical dots" to the right of "racketeers.csv". (If you hover the mouse over these dots, it should say "Layer Options") 3. Click "Open Data

Re: [racket-users] European Racketeers and conferences

2017-10-17 Thread Ben Greenman
Here's a map to some cities where some Racket users are located: https://drive.google.com/open?id=1i3zN11e_6te5ytduAiv1cidrIi4=sharing -- 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] Re: code reflection

2017-10-16 Thread Ben Greenman
> Greg, if you're reading this...any chance you might expand FoM? In the meantime, the "Syntax Parse Examples" package is always accepting contributions: http://docs.racket-lang.org/syntax-parse-example/index.html#%28part._.The_.Examples%29 -- You received this message because you are

Re: [racket-users] Fwd: Racket Con

2017-10-05 Thread Ben Greenman
I have 1 mug (unused) that still needs a home. On Thu, Oct 5, 2017 at 3:18 PM, 'John Clements' via users-redirect < us...@plt-scheme.org> wrote: > Forwarded without comment… :) > > Begin forwarded message: > > *From: *Jasmine Harihar Patel > *Subject: **Racket Con* >

Re: [racket-users] Racket documentation formats

2017-09-29 Thread Ben Greenman
You can download PDFs for most of the documentation here: http://download.racket-lang.org/all-versions.html And if your device has Racket installed, you can run `raco docs` to view a local copy of the HTML. -- You received this message because you are subscribed to the Google Groups "Racket

Re: [racket-users] scribble newbie, myfunctionname undefined

2017-09-28 Thread Ben Greenman
Try adding `#:eval foo-eval` to `interaction`. (I'm guessing that would work.) I'm more sure this will work: #lang scribble/manual @(require scribble/example "../main.rkt") ... @(define foo-eval (make-base-eval '(require "../main.rkt"))) @examples[#:eval foo-eval #:label #f (magic)

Re: [racket-users] document as fn from strings to HTML/text

2017-09-28 Thread Ben Greenman
Yes, you can use scribble/html to define functions from lists to documents. For example, this scribble file calls a function to build an ` ... ` page: https://github.com/nuprl/gtp/blob/gh-pages/about.rkt and here's the function: https://github.com/nuprl/gtp/blob/gh-pages/templates.rkt#L124 --

Re: [racket-users] repeated code in interactions of scribble

2017-09-23 Thread Ben Greenman
You can re-use helper functions by running the different example blocks with the same evaluator (example below). I don't know how to hyperlink one interaction to another. - - - #lang scribble/manual @require[scribble/example] @(define my-eval (make-base-eval)) Beginning. @examples[#:eval

Re: [racket-users] Redex v6.4 "broke" LambdaJS

2017-09-06 Thread Ben Greenman
I think it'll work if you delete the underscores, e.g. change "e_1" to "e1". On Wed, Sep 6, 2017 at 2:22 PM, wrote: > (For some reason the mail I sent to usersracket-lang.org last week > never made it to the Google Group, so I'm posting directly...) > > Hello, > > I'm a

Re: [racket-users] Running a program in multiple languages at once

2017-08-13 Thread Ben Greenman
One idea: - write your program just like that, `1 + 2` with no #lang line, - run your program with a raco command that runs the program once for each language Something like `raco mystery-lang -L lang1 -L lang2 -L lang3 file.txt` In case you need an example raco-command:

Re: [racket-users] A bug in the Typed Racket system?

2017-07-21 Thread Ben Greenman
Type inference is failing you again. If you instantiate `foo/s`, you get the type you expect: #lang typed/racket (struct (a) Foo ([val : (-> a a)])) (: foo/s (All (a b) (-> (-> a b) (-> (Foo a) (Foo b) (Foo b)

Re: [racket-users] Racket7 Conceit

2017-07-19 Thread Ben Greenman
mflatt answered some "why"s on the racket-dev list: https://groups.google.com/d/msg/racket-dev/2BV3ElyfF8Y/4RSd3XbECAAJ On Thu, Jul 20, 2017 at 12:34 AM, Lehi Toskin wrote: > I've read through a few README's in the racket7 repo and I can't find > anything specifically

<    1   2   3   >