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
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)
lidation tasks re: inheritance, overriding, etc. all have to 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
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 getxargs))
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)
> (
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
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
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 thi
the static type system may help you to manage,
> 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
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?`
>
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
m with lambda functions ?
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?
>
>
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+unsubscr...@googlegroups
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 g
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 from
15 matches
Mail list logo