[racket] Antw:Re: Is this a good design
One thing to consider: "if" takes a boolean value as the first part. The
function "string?" evaluates to a boolean value, so you can just use this
result directly instead of seeing if it is equal to "true."
In other words, you could simplify the first part to (if (string? s) ...)
In general, you should always use boolean values directly instead of
comparing them to true or false.
On Wed, Feb 29, 2012 at 11:47 AM, ROELOF WOBBEN <r.wobben at home.nl> wrote:
> Oke,
>
> So no more points which can be better.
>
> Roelof
>
>
> Op 29/02/12, *Joshua Ewulo * <jewulo at gmail.com> schreef:
>
> Hello Roelof,
>
> It does what it says.
>
> Joshua
>
>
> On 29 February 2012 18:14, ROELOF WOBBEN <r.wobben at home.nl <
> r.wobben at home.nl>> wrote:
>
>> (define (string_first s)
>> ( if (eq? (string? s) true) (string-ith s 0 )"You have not entered a
>> string"))
>>
>
>
> ____________________
> Racket Users list:
> http://lists.racket-lang.org/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120229/cb3f058d/attachment.html>