Re: [racket-dev] `racket/string' extensions

2012-04-19 Thread namekuseijin
On Thu, Apr 19, 2012 at 1:28 PM, Eli Barzilay  wrote:
>  (list-index list elt)
>    Looks for `elt' in `list'.  This is a possible extension for
>    `racket/list' that would be kind of obvious with adding the above.
>    [*3*] I'm not sure if it should be added, but IIRC it was
>    requested a few times.

those who requested are not aware of member.

_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] Are There More String Functions?

2012-04-18 Thread namekuseijin
On Wed, Apr 18, 2012 at 4:12 PM, Eli Barzilay  wrote:
> * Finally, I'm also adding a related function:
>  `string-normalize-spaces', which takes a string and a regexp for the
>  spaces, and turns all spaces into single ones.  Same principles as
>  above.  This one is getting a `#:trim?' keyword that says whether
>  spaces at the edges should be dropped (the default) or normalized.
>
>  BTW, I hate that name -- it makes the `string-' prefix looks even
>  uglier...  Any suggestions for a better name?

compact-spaces?  Why should all functions have a type prefix?  How
many functions could be possibly named normalize-spaces not dealing
with strings?

why should it take a regexp for the spaces, BTW?

(compact-spaces "foobar was   here!")

should be self-evident without requiring the user to provide the
common-sense regex everytime...

the `#:trim keyword is a good idea...

_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] today's DrRacket problem

2012-03-26 Thread namekuseijin
oh, cool.

I like easter eggs.  This was no chocolate though. :p

On Mon, Mar 26, 2012 at 11:11 AM, Matthias Felleisen
 wrote:
>
> Dear Racket users,
>
> Many of you noticed that DrRacket v5.2.1 refused to launch today, March 26.
> We sincerely apologize for this inconvenience.
>
> The problem is due to a so-called "Easter egg", which is a visual surprise
> that one developer builds into the code for the others and our users -- a
> tradition going back to the early days of our project. The bug affects only
> DrRacket, no other Racket software.
>
> As far as version 5.2.1 is concerned, it will disappear tomorrow, but it
> will return later this year.  For the upcoming release -- due out before
> the next "easter egg" date -- we will either install much more reliable
> test methods for the Easter eggs or we will remove them entirely.
>
> More immediately, we offer the following workarounds for the DrRacket bug:
>
> * Revert to version 5.2:
>
>   http://download.racket-lang.org/racket-v5.2.html
>
> * In your current installation of 5.2.1, navigate to the following folder:
>
>     collects -> drracket -> private
>
>  remove the file
>
>     drracket-normal.rkt
>
>  and replace it with the corrected copy at
>
>     http://www.cs.utah.edu/plt/fix/drracket-normal.rkt
>
> * For those of you with commandline tool experience, download a Racket
>  patch file from
>
>    http://www.cs.utah.edu/plt/fix/patch-for-v5.2.1.plt
>
>  navigate in your shell to the folder with the 5.2.1 executables, and
>  install the patch with
>
>    ./raco setup -A 
>
>  where  specifies a path to the downloaded file.
>
> As much as we prepare and test these Easter eggs, software obeys only one
> law: what can go wrong will go wrong eventually. We definitely should have
> been more careful.
>
> Once again, we regret any problems we caused you today
>
> -- Matthias Felleisen, for PLT
>
>
> _
>  Racket Developers list:
>  http://lists.racket-lang.org/dev

_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] Issue with languages in Windows

2012-03-19 Thread namekuseijin
On Mon, Mar 19, 2012 at 10:56 PM, Matthew Flatt  wrote:
> At Mon, 19 Mar 2012 21:01:16 -0300, namekuseijin wrote:
>> You know, something that bugs me about DrRacket since the times of
>> DrScheme is that it randomly seems to change the current language to
>> EN, as shown in the attached image.
>>
>> I imagine most of you racket devs don't deal with it, but for users in
>> other countries, it's midly annoying if for no other reason than the
>> keyboard layout changes and ' turns into ` as well as ? goes off.  I
>> have to click back to portuguese so that it works again.
>>
>> I don't know what triggers it, if some combination of keys or
>> whatever, but it consistently behaves like this, several times in a
>> single session.
>>
>> Anyone would be willing to take a look at it?
>
> That sounds annoying. If you can figure out how to replicate the
> problem, I can certainly take a look.

ahahahaha, sorry, dude, couldn't help.  It seems it took me years of
standing it and file a complain here to actually discover it's a
Windows issue:

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/langbar_keystroke_shortcuts.mspx?mfr=true

in other words, sometimes as I type alt+shift to do all the
hierarchical editing, it clashes with the default Windows keycombo to
change the keyboard layout.  So, it's not Racket at fault here.  I'll
just change the Windows default and stop being such a lazy bastard...

_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] Issue with languages in Windows

2012-03-19 Thread namekuseijin
image attached... :p

On Mon, Mar 19, 2012 at 9:01 PM, namekuseijin  wrote:
> You know, something that bugs me about DrRacket since the times of
> DrScheme is that it randomly seems to change the current language to
> EN, as shown in the attached image.
>
> I imagine most of you racket devs don't deal with it, but for users in
> other countries, it's midly annoying if for no other reason than the
> keyboard layout changes and ' turns into ` as well as ? goes off.  I
> have to click back to portuguese so that it works again.
>
> I don't know what triggers it, if some combination of keys or
> whatever, but it consistently behaves like this, several times in a
> single session.
>
> Anyone would be willing to take a look at it?
<>_
  Racket Developers list:
  http://lists.racket-lang.org/dev


[racket-dev] Issue with languages in Windows

2012-03-19 Thread namekuseijin
You know, something that bugs me about DrRacket since the times of
DrScheme is that it randomly seems to change the current language to
EN, as shown in the attached image.

I imagine most of you racket devs don't deal with it, but for users in
other countries, it's midly annoying if for no other reason than the
keyboard layout changes and ' turns into ` as well as ? goes off.  I
have to click back to portuguese so that it works again.

I don't know what triggers it, if some combination of keys or
whatever, but it consistently behaves like this, several times in a
single session.

Anyone would be willing to take a look at it?
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] Simple loop checking in beginner?

2010-11-10 Thread namekuseijin
I see the reasoning now, I apologize.  It's a good choice for
students, not so sure about ye old daily buggy sofware maintenance.

OTOH, perhaps if this practice was widespread it would lead to less
bugs or at least more maintenable software.  At least for those aware
of this "idiom".

On Wed, Nov 10, 2010 at 1:44 PM, Matthias Felleisen
 wrote:
>
> On Nov 10, 2010, at 10:40 AM, namekuseijin wrote:
>
>> On Wed, Nov 10, 2010 at 12:13 AM, John Clements
>>  wrote:
>>> ;; NOW I'M A STUDENT:
>>>
>>> ;; only-long-strings : (listof string) -> (listof string)
>>> ;; return a list containing the strings longer than 2 chars
>>> (define/noloop (only-long-strings l)
>>>  (cond [(empty? l) empty]
>>>        [else (cond [(< 2 (string-length (first l)))
>>>                     (cons (first l)
>>>                           (only-long-strings (rest l)))]
>>>                    [else (only-long-strings l)])]))
>>
>> gosh, students do suck.  I guess you teach them to use cond because
>> it's a generalized if.  But then they proceed to use it just like if:
>> always two conditions per (verbose) cond! :p
>>
>> then again, may be someone who had previous exposure to lesser languages...
>
>
> Perhaps you should ask before you critique.
> We insist on this style:
>
>  -- the outer cond corresponds to the structure of the data definition of the 
> input
>  -- the inner one signals decision relevant for the output
>        (I would use an 'if' for the inner one, but over N years of programming
>        as if a student might see my code one day, I have come to really, truly
>        like the unconditional use of cond for the layout purpose)
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] Simple loop checking in beginner?

2010-11-10 Thread namekuseijin
On Wed, Nov 10, 2010 at 12:13 AM, John Clements
 wrote:
> ;; NOW I'M A STUDENT:
>
> ;; only-long-strings : (listof string) -> (listof string)
> ;; return a list containing the strings longer than 2 chars
> (define/noloop (only-long-strings l)
>  (cond [(empty? l) empty]
>        [else (cond [(< 2 (string-length (first l)))
>                     (cons (first l)
>                           (only-long-strings (rest l)))]
>                    [else (only-long-strings l)])]))

gosh, students do suck.  I guess you teach them to use cond because
it's a generalized if.  But then they proceed to use it just like if:
always two conditions per (verbose) cond! :p

then again, may be someone who had previous exposure to lesser languages...
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] land of lisp, music video/comic/book

2010-10-28 Thread namekuseijin
On Thu, Oct 28, 2010 at 6:11 PM, Shriram Krishnamurthi  
wrote:
> We spent 15 years trying to shake the name "Lisp", and today I feel
> proud to be a Lisp programmer.

according to the web-comic you're actually a useful-at-times
time-travelling nuisance... :p
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] relative lines of C in gracket vs. gracket2

2010-10-28 Thread namekuseijin
On Thu, Oct 28, 2010 at 4:56 PM, Carl Eastlund  wrote:
> On Thu, Oct 28, 2010 at 2:12 PM, namekuseijin  wrote:
>> On Thu, Oct 28, 2010 at 3:48 PM, John Clements
>>  wrote:
>>> So, if I'm reading this correctly, we've gone from ~590K lines of C to 
>>> about ~340K lines of C. That's amazing.
>>
>> hope that doesn't mean more obfuscated C code, though... :p
>
> Unfortunately, it does.  It's all hidden under layers of parentheses
> and strange names with characters like "-" and "?" in them.
> Completely unreadable.  Not a curly brace in sight, and I think it
> just ignores all the semicolons.

sounds like Greenspun's Tenth Rule... ;)
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] relative lines of C in gracket vs. gracket2

2010-10-28 Thread namekuseijin
On Thu, Oct 28, 2010 at 3:48 PM, John Clements
 wrote:
> So, if I'm reading this correctly, we've gone from ~590K lines of C to about 
> ~340K lines of C. That's amazing.

hope that doesn't mean more obfuscated C code, though... :p
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev