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 -nan.0) yields "+nan.0" instead

Re: [racket-users] Defining algebraic data types?

2018-02-05 Thread Sam Tobin-Hochstadt
On Mon, Feb 5, 2018 at 6:36 PM, HiPhish wrote: > Why would that be a problem? The caller has to provide a function for > "adding" > and "multiplying" an N, and as long as I define what it means to multiply > and > add strings it shouldn't matter that I'm using a dual number where both > components

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

2018-02-05 Thread David Storrs
I noticed that (number->string -nan.0) yields "+nan.0" instead of "-nan.0" as I would have expected. It's not an issue for me, but I was wondering why this is? -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and s

Re: [racket-users] Defining algebraic data types?

2018-02-05 Thread HiPhish
Why would that be a problem? The caller has to provide a function for "adding" and "multiplying" an N, and as long as I define what it means to multiply and add strings it shouldn't matter that I'm using a dual number where both components are strings. But I think this is a case of the rectangle

Re: [racket-users] Defining algebraic data types?

2018-02-05 Thread Sam Tobin-Hochstadt
I'm not sure how the "If" got there. But to say more, consider your function: (: dual-* (∀ (N) (→ (Dual-Number N) (Dual-Number N) (→ N N N) (→ N N N) (Dual-Number N (define (dual-* d1 d2 * +) (cond [(D? d1) (D (D-real d1) (D-dual d1))] [else (D d1

Re: [racket-users] Defining algebraic data types?

2018-02-05 Thread HiPhish
Did your email get cut off? On Monday, February 5, 2018 at 6:00:05 PM UTC+1, Sam Tobin-Hochstadt wrote: > > This is an unfortunately common pitfall -- if you instantiated N with > something that includes a dual number, then the type error would be > pointing to a real bug. If > > Sam > -- You

Re: [racket-users] Defining algebraic data types?

2018-02-05 Thread Sam Tobin-Hochstadt
This is an unfortunately common pitfall -- if you instantiated N with something that includes a dual number, then the type error would be pointing to a real bug. If Sam On Feb 5, 2018 7:26 AM, "HiPhish" wrote: > Thank you for your answer, Sam. > > 1) does not really capture it, and 2) is a proo

Re: [racket-users] Defining algebraic data types?

2018-02-05 Thread HiPhish
Thank you for your answer, Sam. 1) does not really capture it, and 2) is a proof of concept that hasn't been updated in almost a year. But it did give me a good idea: use Typed Racket and have the type system work for me. (struct (N) D ([real : N] [dual : N])) (define-type (Dual-Number N) (U

Re: [racket-users] raco distribute help

2018-02-05 Thread Dmitry Pavlov
Deren, In addition to what Matthew has said, I guess you need to have a 'main' module in your language, and provide it to raco exe, too. It can be a dummy module or not. The requirement of such a module is unclear to me, but it exists. Here is my working script to pack a standalone interpreter

[racket-users] [CFP] ICOOOLPS 2018

2018-02-05 Thread Tim Felgentreff
Call for Papers: ICOOOLPS'18 13th Workshop on Implementation, Compilation, Optimization of Object- Oriented Languages, Programs and Systems Co-located with ECOOP 2018 held Mon 16 - Sun 22 July in Amsterdam, Netherlands Twitter: @ICOOOLPS URL: https://conf.researchr.