Re: [racket-users] confusion about real vs not real zero

2021-11-19 Thread Alain De Vos
Check if the distance from (0,0) is "small enough" ? On Friday, November 19, 2021 at 9:32:23 PM UTC+1 Stephen Chang wrote: > I dont want to fully support complex numbers. I just want to do the > minimum so that programs that dont use them are not blocked by the > lack of support > > On Fri, Nov

[racket-users] Re: Questions on a very simple class

2020-02-15 Thread Alain De Vos
nal))) (print (send (new aninteger% [x 2]) getx)) On Sunday, February 16, 2020 at 12:18:53 AM UTC+1, Alain De Vos wrote: > > > Following code makes an "integerclass" with an "add" method : > > #lang racket > (define (integerclass x) > (define (getx)

Re: [racket-users] Questions on a very simple class

2020-02-15 Thread Alain De Vos
be done by > hand here. > > 2. What specific error message did you get? > > *~slg* > > > ‐‐‐ Original Message ‐‐‐ > On Saturday, February 15, 2020 6:18 PM, Alain De Vos > wrote: > > > Following code makes an "integerclass" with an "add&quo

[racket-users] Questions on a very simple class

2020-02-15 Thread Alain De Vos
Following code makes an "integerclass" with an "add" method : #lang racket (define (integerclass x) (define (getx) x) (define (setx! x_new) (set! x x_new)) (define (add y)(integerclass (+ x (y 'getx (lambda (message . args) (case message ((getx) (apply getx

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

2020-02-12 Thread Alain De Vos
ing2value "12345")) On Tuesday, February 11, 2020 at 11:34:16 AM UTC+1, Alain De Vos wrote: > > I tried the following function to conver a String to an Integer. > > #lang typed/racket > (: myconversion (-> String Integer)) > (define (myconversion str) >

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

2020-02-11 Thread Alain De Vos
to an int , 4) subtract corresponding value of zero, 5) allow me to some positional stuff and addition. But first i need a list of characters. :) Does the language has a conversion operator ? On Tuesday, February 11, 2020 at 8:50:33 PM UTC+1, Alain De Vos wrote: > > Very basic question, firs

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

2020-02-11 Thread Alain De Vos
Very basic question, first step first, how do i convert a string astring to a list of characters, #lang typed/racket (require typed/racket/gui) (: astring String) (define astring "1234567890") On Tuesday, February 11, 2020 at 11:34:16 AM UTC+1, Alain De Vos wrote: > > I tri

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

2020-02-11 Thread Alain De Vos
, this is not ok. Otherwise the GUI just keeps eating memory ... On Tuesday, February 11, 2020 at 8:09:31 PM UTC+1, Alain De Vos wrote: > > > > On Tuesday, February 11, 2020 at 5:33:37 PM UTC+1, Philip McGrath wrote: >> >> Others have tried to be more Socratic in pointing you

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

2020-02-11 Thread Alain De Vos
gt; but ultimately can't escape. (Ignoring for the moment fancier type systems > that are mostly still research projects.) > > Your problem with `sweet-exp` is a different one. I'm not familiar with > `sweet-exp`, so I can't really help you, but it looks like either a bug

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

2020-02-11 Thread Alain De Vos
No exact-integer is a check it is not a type. The error described above remains On Tuesday, February 11, 2020 at 3:50:27 PM UTC+1, Alain De Vos wrote: > > > > On Tuesday, February 11, 2020 at 3:25:42 PM UTC+1, Ben Greenman wrote: >> >> You may want `exact-integer?` >

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

2020-02-11 Thread Alain De Vos
On Tuesday, February 11, 2020 at 3:25:42 PM UTC+1, Ben Greenman wrote: > > You may want `exact-integer?` > True , i should use 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

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

2020-02-11 Thread Alain De Vos
ons ? On Tuesday, February 11, 2020 at 12:02:46 PM UTC+1, Ryan Culpepper wrote: > > What should `(myconversion "apple")` return? > What should `(myconversion "12.3")` return? > What does `string->number` do in each of those cases? > > Ryan > >

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

2020-02-11 Thread Alain De Vos
Or is it they idea to write own conversion functions to learn the language. -- 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] How to convert String to Integer

2020-02-11 Thread Alain De Vos
I tried the following function to conver a String to an Integer. #lang typed/racket (: myconversion (-> String Integer)) (define (myconversion str) (string->number str)) The error given is : Type Checker: type mismatch expected: Integer given: (U Complex False) in: (string->number str) I

[racket-users] Mixing different #lang in one application

2020-02-10 Thread Alain De Vos
I want to create a gui app. But then I need: #lang racket/gui But when i click a button i want type control in the functions so i need : #lang typed/racket Are there solutions ? -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe