[racket-users] Auto-generating pdf/html from xml/ascii-Input based on racket/scribble/texlive...possible?

2017-01-25 Thread Meino . Cramer
Hi,

to create html/pdf-documentation from xml/ascii-sources I want to
use racket/scribble/texinfo.

Is it a good idea? Is it possible? Or is it a academic approach only (read: 
pain)? ;)

Thanks a lot for any help!

Cheers
Meino


-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Predictable random...so to say

2016-12-02 Thread Meino . Cramer
Hi Gustavo,

oh YEAH - WHOW...what a *MACHINE* ! :) 8)

Thanks a lot!

Cheers
Meino




Gustavo Massaccesi  [16-12-03 03:18]:
> I suggest to use the current-pseudo-random-generator, because otherwise the
> shuffle/seed will change globally the random sequence of all the program.
> For example:
> 
> ;---
> #lang racket
> 
> ;; shuffle/seed : list? integer -> list?
> (define (shuffle/seed lst seed)
>   (random-seed seed)
>   (shuffle lst))
> 
> (define a-list (list 1 2 3 4 5 6 7 8 9 10))
> 
> (shuffle/seed a-list 0) ;=> '(3 4 9 8 5 1 10 7 6 2)
> (random) ;=> 0.5029567011201275
> (shuffle/seed a-list 0) ;=> '(3 4 9 8 5 1 10 7 6 2)
> (random) ;=> 0.5029567011201275
> (shuffle/seed a-list 1) ;=> '(3 2 1 8 5 10 4 7 6 9)
> (random) ;=> 0.1591727701267079
> (shuffle/seed a-list 1) ;=> '(3 2 1 8 5 10 4 7 6 9)
> (random) ;=> 0.1591727701267079
> 
> (define (shuffle/temp/seed lst seed)
>   (parameterize ([current-pseudo-random-generator
> (make-pseudo-random-generator)])
> (random-seed seed)
> (shuffle lst)))
> 
> (shuffle/temp/seed a-list 0) ;=> '(3 4 9 8 5 1 10 7 6 2)
> (random) ;=> 0.9636171831359096 (may change)
> (shuffle/temp/seed a-list 0) ;=> '(3 4 9 8 5 1 10 7 6 2)
> (random) ;=> 0.6541579154005383 (may change)
> (shuffle/temp/seed a-list 1) ;=> '(3 2 1 8 5 10 4 7 6 9)
> (random) ;=> 0.679958229286436  (may change)
> (shuffle/temp/seed a-list 1) ;=> '(3 2 1 8 5 10 4 7 6 9)
> (random) ;=> 0.22302974490220356 (may change)
> ;---
> 
> [Note: shuffle/temp/seed is a horrible name. I used a different name to
> avoid confusion.]
> 
> Gustavo
> 
> 
> 
> On Fri, Dec 2, 2016 at 5:37 AM,  wrote:
> 
> > Daniel Feltey  [16-12-02 09:28]:
> > > I think something like this works:
> > >
> > > ;; shuffle/seed : list? integer -> list?
> > > (define (shuffle/seed lst seed)
> > >   (random-seed seed)
> > >   (shuffle lst))
> > >
> > > > (define a-list (list 1 2 3 4 5 6 7 8 9 10))
> > > > (shuffle/seed a-list 0)
> > > '(3 4 9 8 5 1 10 7 6 2)
> > > > (shuffle/seed a-list 0)
> > > '(3 4 9 8 5 1 10 7 6 2)
> > > > (shuffle/seed a-list 1)
> > > '(3 2 1 8 5 10 4 7 6 9)
> > > > (shuffle/seed a-list 1)
> > > '(3 2 1 8 5 10 4 7 6 9)
> > >
> > >
> > >
> > > On Fri, Dec 2, 2016 at 2:05 AM,  wrote:
> > >
> > > > Hi,
> > > >
> > > > is there a racket function, which shuffles a list of items
> > > > based on a seed value...that is: Same seed value results in
> > > > same shuffle results?
> > > >
> > > > Cheers
> > > > Meino
> > > >
> > > > --
> > > > 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.com.
> > > > For more options, visit https://groups.google.com/d/optout.
> > > >
> > >
> > > --
> > > 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.com.
> > > For more options, visit https://groups.google.com/d/optout.
> >
> > HI Daniel,
> >
> > thanks a lot...exactly for what I have searched for!
> >
> > Cheers
> > Meino
> >
> >
> > --
> > 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.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> 
> -- 
> 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.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Predictable random...so to say

2016-12-02 Thread Meino . Cramer
Daniel Feltey  [16-12-02 09:28]:
> I think something like this works:
> 
> ;; shuffle/seed : list? integer -> list?
> (define (shuffle/seed lst seed)
>   (random-seed seed)
>   (shuffle lst))
> 
> > (define a-list (list 1 2 3 4 5 6 7 8 9 10))
> > (shuffle/seed a-list 0)
> '(3 4 9 8 5 1 10 7 6 2)
> > (shuffle/seed a-list 0)
> '(3 4 9 8 5 1 10 7 6 2)
> > (shuffle/seed a-list 1)
> '(3 2 1 8 5 10 4 7 6 9)
> > (shuffle/seed a-list 1)
> '(3 2 1 8 5 10 4 7 6 9)
> 
> 
> 
> On Fri, Dec 2, 2016 at 2:05 AM,  wrote:
> 
> > Hi,
> >
> > is there a racket function, which shuffles a list of items
> > based on a seed value...that is: Same seed value results in
> > same shuffle results?
> >
> > Cheers
> > Meino
> >
> > --
> > 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.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> 
> -- 
> 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.com.
> For more options, visit https://groups.google.com/d/optout.

HI Daniel,

thanks a lot...exactly for what I have searched for!

Cheers
Meino


-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Predictable random...so to say

2016-12-02 Thread Meino . Cramer
Hi,

is there a racket function, which shuffles a list of items
based on a seed value...that is: Same seed value results in
same shuffle results?

Cheers
Meino

-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Recursevly processing a list with "wholes"

2016-11-16 Thread Meino . Cramer
Hi Justin,

thanks for reply and the code! :)

Cheers
Meino


Justin Zamora  [16-11-17 04:02]:
> I think you are looking for something like this:
> 
> #lang racket
> 
> (require test-engine/racket-tests)
> 
> (define (remove-empty-lists lst)
>   (cond
> [(null? lst) '()] ; Check for end of list
> [(null? (first lst)) (remove-empty-lists (rest lst))] ; Skip null
> sublist
> [(not (list? (first lst))) ; Leave non-lists alone
>  (cons (first lst) (remove-empty-lists (rest lst)))]
> [else ; Process the sublists recursively
>  (cons (remove-empty-lists (first lst))
>(remove-empty-lists (rest lst)))]))
> 
> (check-expect (remove-empty-lists '()) '())
> (check-expect (remove-empty-lists '(a)) '(a))
> (check-expect (remove-empty-lists '(a b c)) '(a b c))
> (check-expect (remove-empty-lists '(())) '())
> (check-expect (remove-empty-lists '(() a)) '(a))
> (check-expect (remove-empty-lists '(a ())) '(a))
> (check-expect (remove-empty-lists '(a (b () c) d)) '(a (b c) d))
> (check-expect (remove-empty-lists '((a) (b c) () (e () f (g ())) h (() i
> j)))
>   '((a) (b c) (e f (g)) h (i j)))
> (test)
> 
> Justin
> 
> On Tue, Nov 15, 2016 at 10:52 PM,  wrote:
> 
> > Hi,
> >
> > I have a list of sublists. Some of the sublists are empty.
> > The list should be processed recursevly and the resulting
> > list should no longer contain empty sublists.
> >
> > The code I have so far looks like:
> >
> > (define (step-through-list lst)
> > (if (empty? lst)
> > lst
> > (cons (process-sublist (car lst)) (step-through-list (cdr lst)))
> >
> > but "car" would feed empty sublists to process-sublist as any other
> > sublist. How can I "silently" skip empty sublists and even get out of
> > the recursion without harm (if the last sublist is empty) without
> > switching to iteration?
> > Is there something like "car-not-empty" ? ;)
> > Or do I oversee the obvious here...? ;)))
> >
> > Thank you vary much for any help in advance!
> > Cheers
> > Meino
> >
> >
> > --
> > 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.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> 
> -- 
> 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.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Recursevly processing a list with "wholes"

2016-11-16 Thread Meino . Cramer
Hi David,

thanks for the reply and the link! :)

I have a list of sublist, which I want to process recursively.
Some sublists are empty, some are filled.
The typical pattern is (as far as I know)

(define (process-list lst)
(cons (do-somthing-with-sublist (car lst)) (process-lst (car lst

But this has the drawback, that empty sublists (via 'car lst') are
processed also. So I need a "kind of car" which returns not the next
sublist but the next not-empty sublist and skipping any empty sublist
without breaking the recursion.

Others on the list already posted some solutions for what I try to 
acchieve and this is only to clearify things.
Is it now understandable, what I try to acchieve?

Cheers
Meino





David Storrs  [16-11-16 20:16]:
> Hi Meino,
> 
> As a suggestions, you might want to read through this page on Stack
> Overflow about how to ask technical questions:
> http://stackoverflow.com/help/how-to-ask   The summary is:  tell us what
> you're trying to achieve, what you've tried, and what *specifically* is not
> working.
> 
> The question you're asking here (about walk-lists) is hard to help with,
> because it's not clear what the context is.  I'll take my best shot, though:
> 
> On Wed, Nov 16, 2016 at 10:04 AM,  wrote:
> 
> > Hi John,
> >
> > thank you for your reply ! :)
> >
> > ...no, not a homework...
> > I want to teach myself some racket and hope 'to get it' finally...
> > Since I am no native speaker I have the deficulty to search for
> > things, which names I dont know...
> >
> > One example of my code is:
> >
> > (define (trim-list lst)
> >   (if (empty? lst)
> > lst
> > (cons (string-trim (car lst)) (trim-list (cdr lst)
> >
> >
> > (define (walk-sublists lst)
> >   (if (empty? lst)
> > lst
> > (cons (trim-list (car lst)) (walk-sublists (cdr lst)
> >
> > I want to avoid to call trim-list, if 'car lst' returns an empty list.
> > Instead 'car lst' sghould return the next non-empty list...
> >
> > I will take a look in the reference manual for 'filter' and 'compose'.
> >
> > Cheers
> > Meino
> >
> >
> >
> You might try something like this:
> 
> (define (trim-list lst)
>   (if (empty? lst)
> lst
> (cons (string-trim (car lst))
> (trim-list (cdr lst)
> >
> >
> >
> >
> > 'John Clements' via Racket Users 
> > [16-11-16 18:26]:
> > >
> > > > On Nov 15, 2016, at 19:52, meino.cra...@gmx.de wrote:
> > > >
> > > > Hi,
> > > >
> > > > I have a list of sublists. Some of the sublists are empty.
> > > > The list should be processed recursevly and the resulting
> > > > list should no longer contain empty sublists.
> > >
> > > Is this homework?
> > >
> > > if so: can you show your test cases?
> > >
> > > if not: (filter (compose not null?) l).
> > >
> > >
> > > John Clements
> > >
> > > >
> > > > The code I have so far looks like:
> > > >
> > > > (define (step-through-list lst)
> > > >(if (empty? lst)
> > > >lst
> > > >(cons (process-sublist (car lst)) (step-through-list (cdr lst)))
> > > >
> > > > but "car" would feed empty sublists to process-sublist as any other
> > > > sublist. How can I "silently" skip empty sublists and even get out of
> > > > the recursion without harm (if the last sublist is empty) without
> > > > switching to iteration?
> > > > Is there something like "car-not-empty" ? ;)
> > > > Or do I oversee the obvious here...? ;)))
> > > >
> > > > Thank you vary much for any help in advance!
> > > > Cheers
> > > > Meino
> > > >
> > > >
> > > > --
> > > > 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.com.
> > > > For more options, visit https://groups.google.com/d/optout.
> > >
> > >
> > >
> > > --
> > > 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.com.
> > > For more options, visit https://groups.google.com/d/optout.
> > >
> >
> > --
> > 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.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> 
> -- 
> 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.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails 

Re: [racket-users] Recursevly processing a list with "wholes"

2016-11-16 Thread Meino . Cramer
Hi John,

thank you for your reply ! :)

...no, not a homework...
I want to teach myself some racket and hope 'to get it' finally...
Since I am no native speaker I have the deficulty to search for
things, which names I dont know...

One example of my code is:

(define (trim-list lst)
  (if (empty? lst)
lst
(cons (string-trim (car lst)) (trim-list (cdr lst)


(define (walk-sublists lst)
  (if (empty? lst)
lst
(cons (trim-list (car lst)) (walk-sublists (cdr lst)

I want to avoid to call trim-list, if 'car lst' returns an empty list.
Instead 'car lst' sghould return the next non-empty list...

I will take a look in the reference manual for 'filter' and 'compose'.

Cheers
Meino





'John Clements' via Racket Users  [16-11-16 
18:26]:
> 
> > On Nov 15, 2016, at 19:52, meino.cra...@gmx.de wrote:
> > 
> > Hi,
> > 
> > I have a list of sublists. Some of the sublists are empty.
> > The list should be processed recursevly and the resulting
> > list should no longer contain empty sublists.
> 
> Is this homework? 
> 
> if so: can you show your test cases?
> 
> if not: (filter (compose not null?) l).
> 
> 
> John Clements
> 
> > 
> > The code I have so far looks like:
> > 
> > (define (step-through-list lst)
> >(if (empty? lst)
> >lst
> >(cons (process-sublist (car lst)) (step-through-list (cdr lst)))
> > 
> > but "car" would feed empty sublists to process-sublist as any other
> > sublist. How can I "silently" skip empty sublists and even get out of
> > the recursion without harm (if the last sublist is empty) without
> > switching to iteration?
> > Is there something like "car-not-empty" ? ;)
> > Or do I oversee the obvious here...? ;)))
> > 
> > Thank you vary much for any help in advance!
> > Cheers
> > Meino
> > 
> > 
> > -- 
> > 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.com.
> > For more options, visit https://groups.google.com/d/optout.
> 
> 
> 
> -- 
> 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.com.
> For more options, visit https://groups.google.com/d/optout.
> 

-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Recursevly processing a list with "wholes"

2016-11-15 Thread Meino . Cramer
Hi,

I have a list of sublists. Some of the sublists are empty.
The list should be processed recursevly and the resulting
list should no longer contain empty sublists.

The code I have so far looks like:

(define (step-through-list lst)
(if (empty? lst)
lst
(cons (process-sublist (car lst)) (step-through-list (cdr lst)))

but "car" would feed empty sublists to process-sublist as any other
sublist. How can I "silently" skip empty sublists and even get out of
the recursion without harm (if the last sublist is empty) without
switching to iteration?
Is there something like "car-not-empty" ? ;)
Or do I oversee the obvious here...? ;)))

Thank you vary much for any help in advance!
Cheers
Meino


-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] raco run but (please) dont process the docs

2016-11-13 Thread Meino . Cramer
Asumu Takikawa  [16-10-23 18:12]:
> Hi Meino,
> 
> On 2016-10-23 11:09:48 +0200, meino.cra...@gmx.de wrote:
> > It there any way to tell raco what kind
> > of doc processing is wanted and what don't?
> 
> In addition to Daniel's answer, there is a temporary workaround you can do 
> which
> is to install a package with the --no-setup flag like this:
> 
>   raco pkg install --no-setup 
>   raco setup -D
> 
> the -D flag to setup tells it to avoid building docs.
> 
> Cheers,
> Asumu
> 

Hi Asumu,

before I screw up things: 

Does this also work:

   raco pkg update --no-setup --all 
   raco setup -D


???

Thanks a lot for any help in advance! :)

Cheers,
Meino


-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Selecting certain items from a list

2016-11-08 Thread Meino . Cramer
Hi Matthias,

thanks for your reply ! :)


I am learning a lot especially from examples like you gave me!
:)

Cheers
Meino





Matthias Felleisen  [16-11-09 04:04]:
> 
> > On Nov 8, 2016, at 9:36 PM, meino.cra...@gmx.de wrote:
> > 
> > Hi,
> > 
> > From a list of items I want to select certain items. The selecting
> > criterion is the index (nth item).
> > 
> > From this list and from articles on the internet I think that indexing
> > a list and processing a list by index is not a good idea -- at least
> > it seems not to be very "lisp-y" or "racket-y"...
> > 
> > Other options I found:
> > * Convert the list into a vektor, select the indices and convert back.
> > * Do index based list processing none the less.
> > * ...?
> > 
> > Unfortunately there is no other criterion to select the items.
> 
> Here is a way to use indexing into a list w/o incurring much of an overhead: 
> 
> #lang racket
> 
> (module+ test
>   (require rackunit))
> 
> ;; [forall X] [Listof X] N N -> [Listof X]
> 
> (module+ test
>   (check-equal? (pick-from-list-between '(a b c d) 1 2) '(b c)))
> 
> (define (pick-from-list-between lox lower upper)
>   (for/list ((x lox) (i (in-naturals)) #:when (<= lower i upper))
> x))
> 
> 
> — Matthias, not like the rest of the country watching election results roll 
> in 

-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Selecting certain items from a list

2016-11-08 Thread Meino . Cramer
Hi,

>From a list of items I want to select certain items. The selecting
criterion is the index (nth item).

>From this list and from articles on the internet I think that indexing
a list and processing a list by index is not a good idea -- at least
it seems not to be very "lisp-y" or "racket-y"...

Other options I found:
* Convert the list into a vektor, select the indices and convert back.
* Do index based list processing none the less.
* ...?

Unfortunately there is no other criterion to select the items.


What is the adiviced way to do what I want to accomplish?

Thanks a lot for any help!
Cheers
Meino









-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Of editors and mere mortals

2016-11-06 Thread Meino . Cramer

For me it is vim with tslime.

Tim Jervis  [16-11-07 02:48]:
> Emacs (Aquamacs) (with racket-mode and Paredit) for me, with occasional 
> DrRacket use for rare debugging, especially Macros.
> 
> Tim
> 
> > On 5 Nov 2016, at 13:14, Ken MacKenzie  wrote:
> > 
> > So as much as I know there is much love for Dr Racket, I am not the biggest 
> > fan.  Yes I must admit some of its helper features are great for working in 
> > racket and if I must debug something it is probably the best place to work.
> > 
> > Anyway was wondering what other editors people use.  I have been a vim user 
> > for a while.  Lately navigating away from it for more IDE like tasks.  I 
> > have found VS code on linux to actually be a pretty good racket environment 
> > with the drracket plugin available for it.
> > 
> > My latest love is I have started to get into emacs.  Years ago I tried it 
> > and didn't see the advantage over vim.  Now having been coding in racket, 
> > elisp looks less like annoying voodoo to me.  Also I am finding all the 
> > things one can do within emacs that are outside the scope of editing to be 
> > handy.
> > 
> > Anyway just curious what other editors people use.  And particularly if you 
> > use emacs, what add ons or setup do you do for racket or scheme editing in 
> > general.
> > 
> > Ken
> > 
> > -- 
> > 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.com.
> > For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> 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.com.
> For more options, visit https://groups.google.com/d/optout.
> 

-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Meta-question: "Racket to go"andtheformatofthedocumentation...

2016-11-05 Thread Meino . Cramer
Hi David,

thanks for your reply! :)

I installed pdfcrop and processd "reference.pdf" with it like so:
pdfcrop --verbose reference.pdf reference.cropped.pdf

The result was without any margin (this was only a testrun!):
-rw-r--r-- 1 mccramer users   3070399 2016-11-06 04:30 reference.pdf
-rw-r--r-- 1 mccramer users 141998926 2016-11-06 04:35 reference.cropped.pdf
But a little calculation
solfire:pdf/resized>bc
bc 1.06.95
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'. 
141998926/3070399
46.24771112809768372123

shows, that the resulting file was 46x times bigger than the input.
This is little to much for a flash based budget tablet...;)
Any idea to circumeven this?

Cheers
Meino




David Christiansen  [16-11-06 03:33]:
> Hello,
> 
> > Is there a (simple) way to get rid of most
> > of the white blank border and to create
> > the pdfs in a differen page format (aspect
> > ratio) ?
> 
> I often use a little command-line utility called pdfcrop to remove margins
> from PDF files. It's also useful for economical printing of long texts,
> because printing 2 pages per side has less wasted space.
> 
> /David
> 
> -- 
> 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.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Meta-question: "Racket to go"andtheformatofthedocumentation...

2016-11-05 Thread Meino . Cramer

Hi,

I put Racket on different computers and tablets.
So my 7" tablet receives a copy fo Racket :)

But:
The pdfs of the documentation 
have a wide blank border and a ratio aspect,
which is different of that of the tablet.
When viewing the pdfs with mudf, it (mupdf)
tries to disply "the whole page" on the screen,
which in turn results in a very tiny words.
Zooming is not really a solution, since
pageflipping is only avaiable, when the
whole page is displayed.

Is there a (simple) way to get rid of most
of the white blank border and to create
the pdfs in a differen page format (aspect
ratio) ?

Thanks a lot for any help in advance!
Cheers
Meino



-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] The regex and me...

2016-11-05 Thread Meino . Cramer

Hi David,

thanks for your reply ! :)

SUPER! THAT helps!

Is this kinda "pattern", that 
if 'function' does something once, there is a 
'function*' that does the same thing multiple times?

Cheers
Meino




David Storrs  [16-11-05 14:37]:
> (regexp-match* #px"(AA.+?AA)" str)
> 
> 
> regexp-match* matches multiple times through the string.
> 
> As with Perl and pcre in general, a trailing '?' makes quantifers
> non-greedy.
> 
> 
> 
> On Sat, Nov 5, 2016 at 8:59 AM,  wrote:
> 
> > Hi Jens,
> >
> > thanks for your reply! :)
> >
> > ...hmmm...I /think/ I understand the mechanism now...but
> > if it is as it seems to be...I run into another problem.
> >
> > Suppose your have a long line of character with groups
> > of certain chararcter and random caharcters in between.
> >
> > Something like this
> > SHDKJSHKDAHSKJDHSKAABBBAAAKAJSHDOQWDASLDLAAAMEINOAAJASLAKJDL
> > SJDLAAJENSAASJHDKASHDK
> >
> > The pattern here is .
> >
> > The first idea, which came into my mind would be to match with
> > something like
> >
> > (regex-match rx#"(AA[A-Z]+AA))
> >
> > (beside the fact, that I currently dont know, how to match non
> > greedily): The guide says:
> >
> >
> > > (regexp-match #rx"([a-z ]+;)*" "lather; rinse; repeat;")
> >
> > '("lather; rinse; repeat;" " repeat;")
> >
> > Here, the *-quantified subpattern matches three times, but it is the
> > last submatch that is returned.
> >
> > So I would get back AAJENSAA and AAMEINOAA would be matched but not
> > included in the list of matched strings.
> >
> > If the line is of unknown length as the count of "" groups
> > is, I would not know how to cope with this?
> >
> > Is there any other way to get back a list of all found matches instead
> > of only he last one?
> >
> > Thank you very much in advance for any help!
> > Cheers
> > Meino
> >
> >
> >
> >
> > Jens Axel Søgaard  [16-11-04 20:28]:
> > > The first result string is the first matched string. The second result
> > is what was matched by the sub expression in the parenthesis.
> > >
> > >
> > > > Den 4. nov. 2016 kl. 20.04 skrev meino.cra...@gmx.de:
> > > >
> > > > Hi,
> > > >
> > > > Normally I would tend to think, that I am
> > > > quite familiar with regex and their usage
> > > > (background: UNIX?Linux, sed, vi/vim, Perl...)
> > > >
> > > > Then I played a little with regex-match...and
> > > > I have to go to school again..,,
> > > >
> > > > From the Racket guide:
> > > >> (regexp-match #rx"([a-z ]+;)*" "lather; rinse; repeat;")
> > > > '("lather; rinse; repeat;" " repeat;")
> > > >
> > > > [a-z ]: matches one lowercase character of the range of a-z and the
> > #\space
> > > > + : the above one ore more times
> > > > ; : followed by a ';'
> > > > (): all the above grouped
> > > > * : 0 or more times
> > > > seems obvious..
> > > >
> > > > But the result is not (at least for me... ;)
> > > > '("lather; rinse; repeat;" " repeat;")
> > > >
> > > > I understand "lather; rinse; repeat;" as match -
> > > > it reflects the "greedy behaviour" of regex.
> > > >
> > > > But " repeat;" ???
> > > >
> > > > Why not "rinse; repeat;" then???
> > > >
> > > > I am buffled...
> > > >
> > > > (help!)+
> > > >
> > > > :)
> > > >
> > > > (Thank you)+ (much)+ in advance!
> > > > Cheers
> > > > Meino
> > > >
> > > >
> > > >
> > > > --
> > > > 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.com.
> > > > For more options, visit https://groups.google.com/d/optout.
> > >
> > > --
> > > 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.com.
> > > For more options, visit https://groups.google.com/d/optout.
> > >
> >
> > --
> > 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.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> 
> -- 
> 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.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] The regex and me...

2016-11-05 Thread Meino . Cramer
Hi Jens,

thanks for your reply! :)

...hmmm...I /think/ I understand the mechanism now...but
if it is as it seems to be...I run into another problem.

Suppose your have a long line of character with groups
of certain chararcter and random caharcters in between.

Something like this
SHDKJSHKDAHSKJDHSKAABBBAAAKAJSHDOQWDASLDLAAAMEINOAAJASLAKJDLSJDLAAJENSAASJHDKASHDK

The pattern here is .

The first idea, which came into my mind would be to match with
something like

(regex-match rx#"(AA[A-Z]+AA))

(beside the fact, that I currently dont know, how to match non
greedily): The guide says:


> (regexp-match #rx"([a-z ]+;)*" "lather; rinse; repeat;")

'("lather; rinse; repeat;" " repeat;")

Here, the *-quantified subpattern matches three times, but it is the last 
submatch that is returned.

So I would get back AAJENSAA and AAMEINOAA would be matched but not
included in the list of matched strings.

If the line is of unknown length as the count of "" groups
is, I would not know how to cope with this?

Is there any other way to get back a list of all found matches instead
of only he last one?

Thank you very much in advance for any help!
Cheers
Meino




Jens Axel Søgaard  [16-11-04 20:28]:
> The first result string is the first matched string. The second result is 
> what was matched by the sub expression in the parenthesis.
> 
> 
> > Den 4. nov. 2016 kl. 20.04 skrev meino.cra...@gmx.de:
> > 
> > Hi,
> > 
> > Normally I would tend to think, that I am 
> > quite familiar with regex and their usage
> > (background: UNIX?Linux, sed, vi/vim, Perl...)
> > 
> > Then I played a little with regex-match...and
> > I have to go to school again..,,
> > 
> > From the Racket guide:
> >> (regexp-match #rx"([a-z ]+;)*" "lather; rinse; repeat;")  
> > '("lather; rinse; repeat;" " repeat;")
> > 
> > [a-z ]: matches one lowercase character of the range of a-z and the #\space
> > + : the above one ore more times
> > ; : followed by a ';'
> > (): all the above grouped 
> > * : 0 or more times
> > seems obvious..
> > 
> > But the result is not (at least for me... ;)
> > '("lather; rinse; repeat;" " repeat;")
> > 
> > I understand "lather; rinse; repeat;" as match -
> > it reflects the "greedy behaviour" of regex.
> > 
> > But " repeat;" ???
> > 
> > Why not "rinse; repeat;" then???
> > 
> > I am buffled...
> > 
> > (help!)+
> > 
> > :)
> > 
> > (Thank you)+ (much)+ in advance!
> > Cheers
> > Meino
> > 
> > 
> > 
> > -- 
> > 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.com.
> > For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> 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.com.
> For more options, visit https://groups.google.com/d/optout.
> 

-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] The regex and me...

2016-11-04 Thread Meino . Cramer
Hi,

Normally I would tend to think, that I am 
quite familiar with regex and their usage
(background: UNIX?Linux, sed, vi/vim, Perl...)

Then I played a little with regex-match...and
I have to go to school again..,,

>From the Racket guide:
> (regexp-match #rx"([a-z ]+;)*" "lather; rinse; repeat;")  
'("lather; rinse; repeat;" " repeat;")

[a-z ]: matches one lowercase character of the range of a-z and the #\space
+ : the above one ore more times
; : followed by a ';'
(): all the above grouped 
* : 0 or more times
seems obvious..

But the result is not (at least for me... ;)
'("lather; rinse; repeat;" " repeat;")

I understand "lather; rinse; repeat;" as match -
it reflects the "greedy behaviour" of regex.

But " repeat;" ???

Why not "rinse; repeat;" then???

I am buffled...

(help!)+

:)

(Thank you)+ (much)+ in advance!
Cheers
Meino



-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: How "expensive" are regular expression in Racket in general?

2016-11-04 Thread Meino . Cramer
Hi George,

thanks for your reply! :)

I know Perl and its regexp quite well...so I will
go for the regexified solution first.

But...I fear I have to sort my brain first. I played around
a little with regex-match and friends...and often I dont 
understand the results...

Cheers
Meino



George Neuner  [16-11-04 17:48]:
> On Fri, 4 Nov 2016 04:03:53 +0100,
> meino.cra...@gmx.de wrote:
> 
> >I have to break down input from textfiles in lists. Due to
> >missing formatting symbols like ";" (csv) I have do it more
> >"analogous". ;)
> >
> >It can be done by regex and it can be done by line splitting,
> >procesing the results (removing superflous whitespace) and 
> >selecting from that result what I need.
> >
> >There are lot of lines to process
> >
> >How fast are regex in racket in comparison to the other way to
> >implement the whole thing?
> 
> If the matching is complicated, regex probably will be faster than
> what you could write yourself.
> 
> I don't have numbers handy, but IME Racket's regex - once the data is
> in memory - is comparable in speed to Perl's.   For technical reasons,
> Racket's I/O is somewhat slower than Perl's, and that can make a
> noticable difference with very large files. 
> [But if you're still talking about ~20K lines, that really isn't very
> "large" and the difference likely would be hard to notice without
> timing it.]
> 
> George
> 
> -- 
> 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.com.
> For more options, visit https://groups.google.com/d/optout.
> 

-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] How "expensive" are regular expression in Racket in general?

2016-11-04 Thread Meino . Cramer

Hi David,

thanks for your reply! :)

...unfortunatelu this wpuld imply to implement both solution
correctly and compare them.
I asked here on the mailinglist fpr the better solution just
to avoid that... ;)

Cheers
Meino



David Storrs  [16-11-04 17:36]:
> That's a good question -- I don't know the answer, but you can actually
> test it for yourself with the benchmarking library:
> https://docs.racket-lang.org/benchmark/index.html
> 
> Post the results back, would you?  I'd be curious to know for myself.
> 
> 
> 
> On Thu, Nov 3, 2016 at 11:03 PM,  wrote:
> 
> > Hi,
> >
> > (this is by no means any critism against Racket!)
> >
> > I have to break down input from textfiles in lists. Due to
> > missing formatting symbols like ";" (csv) I have do it more
> > "analogous". ;)
> >
> > It can be done by regex and it can be done by line splitting,
> > procesing the results (removing superflous whitespace) and
> > selecting from that result what I need.
> >
> > There are lot of lines to process
> >
> > How fast are regex in racket in comparison to the other way to
> > implement the whole thing?
> >
> > Thanks a lot for any help in advance!
> > Cheers
> >  Meino
> >
> >
> >
> > --
> > 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.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> 
> -- 
> 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.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] How "expensive" are regular expression in Racket in general?

2016-11-03 Thread Meino . Cramer
Hi,

(this is by no means any critism against Racket!)

I have to break down input from textfiles in lists. Due to
missing formatting symbols like ";" (csv) I have do it more
"analogous". ;)

It can be done by regex and it can be done by line splitting,
procesing the results (removing superflous whitespace) and 
selecting from that result what I need.

There are lot of lines to process

How fast are regex in racket in comparison to the other way to
implement the whole thing?

Thanks a lot for any help in advance!
Cheers
 Meino



-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] docs for string-trim

2016-11-01 Thread Meino . Cramer
Hi,

when using the search function for the Racket-docs
with string-trim I found:

-
Trims the input str by removing prefix and suffix sep, which defaults to 
whitespace. A string sep is matched literally (as opposed to being used as a 
regular expression).

Use #:left? #f or #:right? #f to suppress trimming the corresponding side. When 
repeat? is #f (the default), only one match is removed from each side; when 
repeat? is true, all initial or trailing matches are trimmed (which is an 
alternative to using a regular expression sep that contains +).

Examples:

> (string-trim "  foo bar  baz \r\n\t")
"foo bar  baz"
> (string-trim "  foo bar  baz \r\n\t" " " #:repeat? #t)
"foo bar  baz \r\n\t"
> (string-trim "aaaxaayaa" "aa")
"axaay"
-

It says, that #:repeat is false if not given (the default).
It looks like, that the first example has a little bug: Both
#\space characters are removed from in front of "foo" - identical
to the second example, where #:repeat is given (#t).

...or I need more coffee or more sleep... ;)

Cheers
Meino




-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Recursive stepping down a list patially?

2016-11-01 Thread Meino . Cramer

Hi Jon,

thank you for your mind reading! :::)))

Exactly! 
Now I know, that racket passes references under the hood
and the world is getting a better place again.

Cheers
Meino



Jon Zeppieri  [16-11-01 04:40]:
> On Mon, Oct 31, 2016 at 11:28 PM,  wrote:
> 
> >
> > Hi Jon,
> >
> > thanks for reply! :)
> >
> > My plan was, to return only one element from that list and
> > possibly some extra informations and pass that to the processing
> > function so it could right jump onto that train...
> >
> > Is that possible?
> >
> >
> I think I understand your concern, and I think it's misplaced. Here's what
> I think you're suggesting: you don't want to return the entire remainder of
> the list, because (as you said) it's a really long list, and you're
> concerned about passing around (and possibly duplicating) a ton of data.
> But that's not the way it works. In terms of in-memory representation, all
> that the `member` functions return is a pointer to a position (a particular
> pair) in the original list.
> 
> You seem to be thinking of something like this: if you were using a vector,
> you could return the element and the index where you found that element.
> Then you could continue on from the next index. And you wouldn't want to do
> this with a list, because if you start at the head of the original list,
> you'd first have to follow it down to the nth element before continuing on,
> and that would be inefficient. But what I'm saying is that if you simply
> return the tail of the list using a `member` function, you don't incur that
> extra iteration cost, and you don't duplicate any of the original list.
> 
> - Jon

-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Recursive stepping down a list patially?

2016-11-01 Thread Meino . Cramer


Hi David,

thanks for your...:) DOCUMENTATION PROJECT :).!!!
Whow!
Now I have a lot to read! 

Cheers
Meino


David Storrs  [16-11-01 18:47]:
> Hi Meino,
> 
> Good news!  There are built-ins that will do almost all of this for you:
> 
> On Mon, Oct 31, 2016 at 10:53 PM,   wrote:
> > Hi,
> >
> > I have a lng list of something. And I have a recursive serach
> > function to crawl down the list and search for a previously determined
> > item.
> > When found, the search processes stops and returns that item of the
> > list.
> 
> Check the following pages:
> https://docs.racket-lang.org/reference/pairs.html  (cf 'member' and 'memf')
> https://docs.racket-lang.org/guide/for.html   (short intro on 'for')
> https://docs.racket-lang.org/reference/for.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._for%29%29
> (full documentation of all versions of 'for')
> 
> >
> > In a second step, I want to process the list starting with that
> > certain item til the end of the list.
> >
> > Is it possible to jump right into a list at a certain item of
> > the list and to start processing there?
> 
> Yes.  What you want is list-ref
> 
> 
> (define my-list '(a b c d e f g))
> 
> (list-ref
> 
>  (list
> 
>  'a 'b 'c) 0)
> 
> 'a
> 
> 
> >  Could the search function
> > return a certain extra information so that another function could
> > pick up that item directly and start recursing from there?
> > """Distributed recursion""" somehow...?
> 
> Yes.  There's various ways, but the simplest would be:
> 
> (define my-list '(a b c d e f g))
> (define search (lambda (x) (equal? x 'd)))
> (define further-processing (lambda (lst) ( ... do something here ...)))
> 
> (memf search my-list)  ;;   =>  returns '(d e f g)
> 
> 
> ;;   Find the interesting element, save the list from that point on for
> future use
> (define interesting-part-of-list
> (memf search my-list))
> 
> ;;   Or, alternatively, find the interesting element, then send it and the
> rest of the list directly to 'further-processing'
> (further-processing
> (memf search my-list))
> 
> 
> Side note:  The following two ways of defining a function are equivalent:
> 
> (define foo (lambda (x) 7))
> (define (foo x) 7)
> 
> 
> Hope this helps.
> 
> Dave
> 
> -- 
> 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.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Recursive stepping down a list patially?

2016-11-01 Thread Meino . Cramer
'John Clements' via Racket Users  [16-11-01 
18:47]:
> 
> > On Nov 1, 2016, at 8:02 AM, David Storrs  wrote:
> > 
> ...
> > > Is it possible to jump right into a list at a certain item of
> > > the list and to start processing there?
> > 
> > Yes.  What you want is list-ref 
> > 
> > (define my-list '(a b c d e f g))
> > 
> > (list-ref (list 'a 'b 'c) 0)
> > 'a
> 
> 
> Oog, no, don’t do that. The earlier solution, by returning the list (or, if 
> you prefer, “a pointer to the list”), ensure that the entire (resumed) search 
> takes time linear in the length of the list. But indexing into the list with 
> ‘list-ref’ will require re-traversing the first part of the list, probably 
> turning an O(n) operation into an O(n^2) operation.
> 
> Right?
> 
> John
> 
> 
> 
> -- 
> 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.com.
> For more options, visit https://groups.google.com/d/optout.
> 

Hi John,

thanks for your reply! :)

My first assumption was, that returning the tail of a list would
return a FULL COPY (*>S<*) of that tail made me feels not very
comfortable about that kind of solution.

But...
:)

If under the hood racket transfers references...NO PROBLEM!
I like that! 8)

Cheers
Meino

-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Recursive stepping down a list patially?

2016-11-01 Thread Meino . Cramer
George Neuner  [16-11-01 18:47]:
> On Tue, 01 Nov 2016 06:47:24 +0100, Vincent St-Amour
>  wrote:
> 
> >FWIW, your `find-it` is a thin wrapper over `memf` from `racket/base`.
> >
> >Vincent
> 
> Sort of.  In a roundabout way, the OP also asked about how to return
> multiple values from a function.  memf doesn't do that.
> 
> My point was to illustrate what needed to be done to solve the problem
> - not to hand up a ready solution from the library.  
> 
> Racket's massive batteries-included implementation surely is a
> blessing for practitioners, but IMO it's more a curse for newbies
> trying to learn technique.  
> 
> YMMV,
> George
> 
> -- 
> 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.com.
> For more options, visit https://groups.google.com/d/optout.
> 

Hi George,

thanks for your reply! :)

...I think it is a good way to learn racket for a racket newbie like
me by looking at the mechanisms and building blocks to access those
mechanisms. 

Cheers 
Meino



-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Recursive stepping down a list patially?

2016-11-01 Thread Meino . Cramer
Hi Vincent,

thanks for your info! :)

...but unfortunately I cannot find find-it in
the docs...

Cheers
Meino




Vincent St-Amour  [16-11-01 18:47]:
> FWIW, your `find-it` is a thin wrapper over `memf` from `racket/base`.
> 
> Vincent
> 
> 
> 
> On Tue, 01 Nov 2016 05:06:47 +0100,
> George Neuner wrote:
> > 
> > On Tue, 1 Nov 2016 04:28:26 +0100,
> > meino.cra...@gmx.de wrote:
> > 
> > >
> > >Hi Jon,
> > >
> > >thanks for reply! :)
> > >
> > >My plan was, to return only one element from that list and
> > >possibly some extra informations and pass that to the processing
> > >function so it could right jump onto that train...
> > >
> > >Is that possible?
> > 
> > Sure. I'm guessing that the list elements are not simple values that
> > can be matched directly, but rather you need to extract and match a
> > search key.
> > 
> > You can do something like:
> > 
> > (define (find-it lst key)
> >   (cond
> > ([null? lst]
> >  ;; end of the list
> >  (list #f '()))
> > ([equal? (car lst) key]
> >  ;; matched the search key
> >  ;; return item and next list position
> >  (list (car lst)(cdr lst)))
> > (else
> >  ;; keep going
> >  (find-it (cdr lst) key))
> >  ))
> > 
> > 
> > To return the 2 values, you can use a list, a vector, a structure or
> > even (values).  Depends on what you need to do with them.
> > 
> > 
> > In Racket (or Scheme or Lisp) an object is just a reference to a heap
> > allocation somewhere.  In C terms, you are always dealing with
> > pointers that are implicitly dereferenced when you look at them ...
> > and it isn't possible to get a null pointer.  
> > [Actually it's more like workin with references in C++.]
> > 
> > When you return the "tail of the list", all that is being passed is a
> > pointer to some element of the original list.
> > 
> > This explanation is very simplistic [and not quite correct], but it is
> > close enough to reality that you won't go far wrong thinking about
> > things in this way.  The technical details are too involved for you to
> > worry about until you learn more.
> > 
> > Hope this helps,
> > George
> > 
> > -- 
> > 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.com.
> > For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> 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.com.
> For more options, visit https://groups.google.com/d/optout.
> 

-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Recursive stepping down a list patially?

2016-11-01 Thread Meino . Cramer
Hi Ken,

thanks for your reply ! :)

...sorry, I forgot to mention a certain aspect:
The list begins with unwanted items and after that,
all following items are wanted.
Finding the first wanted item means: The search is over
now, from here happiness will start! :)
"Filter"ing means to crawl down the _whole_ list, inspecting
each and every item of the list while assuming
that wanted and unwanted items are well mixed like tutti frutti.

sorry for not getting the specification right... ;)


Cheers
Meino





Ken MacKenzie  [16-11-01 18:47]:
> I am wondering why not use a filter on the list?
> 
> Ken
> 
> 
> On Monday, October 31, 2016 at 10:53:25 PM UTC-4, meino.cramer wrote:
> > Hi,
> > 
> > I have a lng list of something. And I have a recursive serach
> > function to crawl down the list and search for a previously determined
> > item.
> > When found, the search processes stops and returns that item of the
> > list.
> > 
> > In a second step, I want to process the list starting with that
> > certain item til the end of the list.
> > 
> > Is it possible to jump right into a list at a certain item of
> > the list and to start processing there? Could the search function
> > return a certain extra information so that another function could
> > pick up that item directly and start recursing from there?
> > """Distributed recursion""" somehow...?
> > 
> > (I know, that vectors can do that and that there is 
> > a function to convert a list to a vector and vice versa and
> > the real programmer would call the processing function from
> > the search function when the certain item is found --
> > but all this would make this email/question superflous... 
> > ;)))
> > 
> > Cheers
> > Meino
> 
> -- 
> 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.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: [OT]: Receiving doubled mail and mutt (Linux/UNIX mailclient)

2016-11-01 Thread Meino . Cramer
George Neuner  [16-11-01 18:47]:
> On Tue, 1 Nov 2016 09:24:54 -0400, David Storrs
>  wrote:
> 
> >I also have been getting [duplicate posts], and I use GMail.
> >
> >I suspect part of the problem is that when I hit "Reply All" to this
> >message, it was going to send to "Meino + list" and I had to
> >explicitly delete your name before sending.
> 
> Email clients filter duplicates based on the message id header.  When
> you "reply all", the individual messages sent to all the recipients
> all have the same message id.
> 
> A list server _should_ rebroadcast incoming messages with their ids
> unchanged.  A recipient that receives a message directly and also
> receives a copy from the list *should* see them as duplicates, and a
> mail client _normally_ should not deliver duplicates.
> 
> But I think Google Groups is changing the message ids when it
> broadcasts, with the result that mail clients think the copies from
> the list are new messages.
> 
> 
> I don't see duplicates from non-Google-hosted lists even if I am CC'd
> directly.  My opinion is Google's server is misconfigured.
> 
> YMMV,
> George 
> 
> -- 
> 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.com.
> For more options, visit https://groups.google.com/d/optout.
> 

Hi David, hi George,

thanks for replying to my OT-mail.
I think I have found the problem:
In the rc-file of the mail client I not 
only have to explain, that there is new
folder with the posting of a newly added mailinglist
(which I did) BUT I have also add the address of that
mailinglist to that rc-file (which I forgot, fixed now).
The answer should only arrive at the mailinglist.
Should be fixed now.

Thanks again for your help and information!
Cheers
Meino


-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] [OT]: Receiving doubled mail and mutt (Linux/UNIX mailclient)

2016-10-31 Thread Meino . Cramer
Hi,

not a Racket thing...

>From all threads I started or posted to I receive each mail twice.
I am using "mutt", the lInux mail client, to write and compose mails.
Mutt knows about mailinglists. Normally "r"eplaying to a posting 
of a mailinglist, mutt asked "Reply tp list? [yes]/no" and hitting
 accepts the default of replying to the list.
For unknown reasons this seems not work with the racket mailinglist.
I had to press "g" (reply all) to reply to the mailinglist.
Are there some differences to other mailinglists which mau
trigger this (and may be the root cause of the doubled mails
in turn?)?

What can I do to fix that?
Cheers
Meino

-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Recursive stepping down a list patially?

2016-10-31 Thread Meino . Cramer
Hi George,

thanks for your reply! :)

THAT HELPS!
Thanks for the look inside of racket!

Cheers
Meino



George Neuner  [16-11-01 05:20]:
> On Tue, 1 Nov 2016 04:28:26 +0100,
> meino.cra...@gmx.de wrote:
> 
> >
> >Hi Jon,
> >
> >thanks for reply! :)
> >
> >My plan was, to return only one element from that list and
> >possibly some extra informations and pass that to the processing
> >function so it could right jump onto that train...
> >
> >Is that possible?
> 
> Sure. I'm guessing that the list elements are not simple values that
> can be matched directly, but rather you need to extract and match a
> search key.
> 
> You can do something like:
> 
> (define (find-it lst key)
>   (cond
> ([null? lst]
>  ;; end of the list
>  (list #f '()))
> ([equal? (car lst) key]
>  ;; matched the search key
>  ;; return item and next list position
>  (list (car lst)(cdr lst)))
> (else
>  ;; keep going
>  (find-it (cdr lst) key))
>  ))
> 
> 
> To return the 2 values, you can use a list, a vector, a structure or
> even (values).  Depends on what you need to do with them.
> 
> 
> In Racket (or Scheme or Lisp) an object is just a reference to a heap
> allocation somewhere.  In C terms, you are always dealing with
> pointers that are implicitly dereferenced when you look at them ...
> and it isn't possible to get a null pointer.  
> [Actually it's more like workin with references in C++.]
> 
> When you return the "tail of the list", all that is being passed is a
> pointer to some element of the original list.
> 
> This explanation is very simplistic [and not quite correct], but it is
> close enough to reality that you won't go far wrong thinking about
> things in this way.  The technical details are too involved for you to
> worry about until you learn more.
> 
> Hope this helps,
> George
> 
> -- 
> 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.com.
> For more options, visit https://groups.google.com/d/optout.
> 

-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Recursive stepping down a list patially?

2016-10-31 Thread Meino . Cramer

Hi Jon,

thanks for reply! :)

My plan was, to return only one element from that list and
possibly some extra informations and pass that to the processing
function so it could right jump onto that train...

Is that possible?

Cheers
Meino



Jon Zeppieri  [16-11-01 04:20]:
> On Mon, Oct 31, 2016 at 10:53 PM,  wrote:
> 
> > Hi,
> >
> > I have a lng list of something. And I have a recursive serach
> > function to crawl down the list and search for a previously determined
> > item.
> > When found, the search processes stops and returns that item of the
> > list.
> >
> > In a second step, I want to process the list starting with that
> > certain item til the end of the list.
> >
> > Is it possible to jump right into a list at a certain item of
> > the list and to start processing there? Could the search function
> > return a certain extra information so that another function could
> > pick up that item directly and start recursing from there?
> > """Distributed recursion""" somehow...?
> >
> >
> The tail of a non-empty list is simply a list, so, if I understand you
> correctly, what you want to do is very straightforward. The `member` (and
> `memq` / `memv` / `memf` ) functions are meant for exactly this sort of
> thing. In your first step, instead of returning just the member of the list
> you're interested in, you can return the sublist that starts with that
> item. For example, let's say you have a list of strings that looks like
> this:
> 
> (define xs '("one" "two" "three" "four" "five"))
> 
> And you want to find "three." Then you can do:
> 
> (member "three" xs)
> 
> ... which returns:
> 
> '("three" "four" "five")
> 
> The first element of the result is the element you wanted, and the
> remainder of the list is everything after it.
> 
> You'll want `memf` if you need to search by some arbitrary function. See
> the documentation for this group of functions.
> 
> - Jon
> 
> -- 
> 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.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Recursive stepping down a list patially?

2016-10-31 Thread Meino . Cramer
Hi,

I have a lng list of something. And I have a recursive serach
function to crawl down the list and search for a previously determined
item.
When found, the search processes stops and returns that item of the
list.

In a second step, I want to process the list starting with that
certain item til the end of the list.

Is it possible to jump right into a list at a certain item of
the list and to start processing there? Could the search function
return a certain extra information so that another function could
pick up that item directly and start recursing from there?
"""Distributed recursion""" somehow...?

(I know, that vectors can do that and that there is 
a function to convert a list to a vector and vice versa and
the real programmer would call the processing function from
the search function when the certain item is found --
but all this would make this email/question superflous... 
;)))

Cheers
Meino




-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Searching in data the Racket way...

2016-10-30 Thread Meino . Cramer

Hi Matthias,

thanks for your reply ! :)

H...your are asking a newbie, what not linear in processing
lists...h... ;)

I read somewhere on the net, that - in opposite to vectors --
processing lists is not linear. I /think/ (read: dont know for
sure), that searching needs extra time to jump along the
links of the list (linked list, isn't it?) to the next element,
while searching a vector needs (internally) only adding an index to a 
base pointer to acces the next element.

So accessing the 1000th element of a list needs 1000 times 
"jump via link" plus inspecting the 1000th element and doing the 
same with a vector needs accessing the addr=(base address)+ (999* item size)
and inspecting the element.
Therefore the processing time of an element of a vector does not
depend on the position of the element itsself.

WARNING! THIS IS BASED ON "C" KNOWLEDGE!
MAY BE TOTALLY WRONG!

The code to implement the search is (hopefully, fingers crossed...)
not the problem...I simply dont know data type/construct to choose
to make it a little faster...

Cheers,
Meino


Matthias Felleisen  [16-10-30 12:28]:
> 
> > On Oct 30, 2016, at 11:02 AM, meino.cra...@gmx.de wrote:
> > 
> > Hi,
> > 
> > (still fiddling around with those data of shortwave broadcasters and
> > their schedules...)
> > 
> > The data in question consists of 7400 lines of 16 fields each. Not all
> > fields are filled in eacht line. The already existing code reads the
> > data into lists of sublists of 16 fields/items.
> > 
> > I want to prepare those data in a way, that I will be able to do searches
> > like "give me all broadcaster, which broadcasts are in English.
> > Furthermore give me broadcasts on Thursdays only between 5:30
> > pm and 8:00 pm on bands between 9000Khz and 12000khz”.
> 
> This looks like a “one-liner” to me in Racket: 
> 
> (filter (lambda (r) (and (language-is r English) (broadcast-day-is Thursday) 
> (broadcast-time-is-between 5:30 8:00) (broadcast-frequencies-are-between 9000 
> 12000)) list-of-data)
> 
> What’s not linear about this? 
> 
> 
> — Matthias
> 
> 
> 
> > 
> 
> > For the learning effect I want to do this in racket onlu and (despite 
> > knowing that this may be a better solultion performance wise) dont
> > want to use tools like sqlite or such.
> > 
> > What I read/think is:
> > Lists processing is not linear: The longer the list, the slower the
> > data processing.
> > Hashes are somehow problematic due to the data:
> > There is no real unique key beside an artificial, additonally created
> > IDwhich is of no information to the user...
> > Vectors? Linear performance in opposite to lists...but searching
> > in a vector of vectors ,,, is that sane enough to be implementable? ;)
> > What else?
> > 
> > 
> > Cheers,
> > Meino
> > 
> > -- 
> > 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.com.
> > For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> 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.com.
> For more options, visit https://groups.google.com/d/optout.
> 

-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Searching in data the Racket way...

2016-10-30 Thread Meino . Cramer
Hi,

(still fiddling around with those data of shortwave broadcasters and
their schedules...)

The data in question consists of 7400 lines of 16 fields each. Not all
fields are filled in eacht line. The already existing code reads the
data into lists of sublists of 16 fields/items.

I want to prepare those data in a way, that I will be able to do searches
like "give me all broadcaster, which broadcasts are in English.
Furthermore give me broadcasts on Thursdays only between 5:30
pm and 8:00 pm on bands between 9000Khz and 12000khz".

For the learning effect I want to do this in racket onlu and (despite 
knowing that this may be a better solultion performance wise) dont
want to use tools like sqlite or such.

What I read/think is:
Lists processing is not linear: The longer the list, the slower the
data processing.
Hashes are somehow problematic due to the data:
There is no real unique key beside an artificial, additonally created
IDwhich is of no information to the user...
Vectors? Linear performance in opposite to lists...but searching
in a vector of vectors ,,, is that sane enough to be implementable? ;)
What else?


Cheers,
Meino

-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Print...a newbies problem ;)

2016-10-30 Thread Meino . Cramer
Hi Georgs,

thanks for your reply! :)

NICE!

Even here, in the non-imperative, functional world, "C" leaves
its footprints in the snow... :

Cheers,
Meino



George Neuner  [16-10-30 10:08]:
> On Sat, 29 Oct 2016 13:45:43 +0200,
> meino.cra...@gmx.de wrote:
> 
> >currently I am still doing old-school "printf()-debugging", knowing
> >that it's '(print arg)' rather than 'printf( fmt, val,...);". :)
> 
> Just FYI:  Racket does have printf, fprintf and eprintf.  
> The format strings are a little different from those in C.
> 
> See  https://docs.racket-lang.org/reference/Writing.html
> 
> George
> 
> -- 
> 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.com.
> For more options, visit https://groups.google.com/d/optout.
> 

-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Print...a newbies problem ;)

2016-10-30 Thread Meino . Cramer

Hi Matthew,

thanks for your reply ! :)

The problem was: That print loop creates a lot of #\spaces before
dumping the 7000+ of data lines. And there was no #\n between the
lines.

In vim I saw "nothing" (not exspecting that there were valid
data after those spaces).
On the console this block of spaces were ast scrolled out of sight
and the valid data were shown.

And I thought, dumping into vim does something different than dumping
to the console.

I didn't know of log-error before...thanks for that info ! :)

Cheers
Meino



Matthew Flatt  [16-10-30 08:36]:
> Probably you need to use `flush-output` to make sure that your printed
> output is sent to the pipe.
> 
> When stdout goes to a terminal, the default buffer mode is
> line-buffered, so that printing a newline causes output to be flushed.
> For any other output destination, including a pipe to another process,
> the default buffer mode is block-buffered, so that output will not be
> flushed until the buffer is full.
> 
> Another approach is to write to stderr instead of stdout, since stderr
> is never buffered by default.
> 
> I normally use `log-error` instead of printf. The output goes to stderr
> when I run on the command line, but it adapts better to other
> environments, such as running in DrRacket (where it goes to the log
> window).
> 
> At Sat, 29 Oct 2016 13:45:43 +0200, meino.cra...@gmx.de wrote:
> > Hi,
> > 
> > currently I am still doing old-school "printf()-debugging", knowing
> > that it's '(print arg)' rather than 'printf( fmt, val,...);". :)
> > 
> > Since my program reads a bigger textfile of shortwave broadcasters,
> > their frequencies, on-air times, etc, reformats the whole thing
> > and (currently only to proof, everything is correct) prints it.
> > 
> > Since I need to now, where strings are starting and ending, I am using
> > 'print' for that rather than 'pretty-print' or 'display'.
> > 
> > I am doing all this on UNIX/Linux.
> > 
> > To give myself a chance of reading the output I do this
> > 
> > racket shwrefmt.rkt | vim -
> > 
> > which reads everything, which goes to stdout into vim.
> > 
> > As long as I am using 'display', everything is fine.
> > When using 'print' the output mutates to smoke and vanishes in the pipe -
> > Vim starts with nothing to show.
> > 'print'ing to the console works fine, though.
> > 
> > Giving at the REPL
> > > (current-output-port)
> > it says
> > #
> > 
> > which looks like the good-old STDOUT of UNIX to me...
> > 
> > Where is the output gone? <>
> > 
> > Thanks a lot for any help in advance!
> > Cheers,
> > Meino
> > 
> > 
> > 
> > 
> > 
> > -- 
> > 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.com.
> > For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> 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.com.
> For more options, visit https://groups.google.com/d/optout.
> 

-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] cvs-reading ?

2016-10-30 Thread Meino . Cramer

Hi John,

thanks for your reply! :)

the only cause for makeing my life "terrible" at that moment
was myself and the lack of coffee
I confused csv with cvs
No need to apologize for anything, John!!!
I am the only person, who needs to apologize...you understand
everything correctly...

Only at work autocorrection is makeing my life terrible...in
that moments I want my Linux back... :)

Cheers
Meino



'John Clements' via Racket Users  [16-10-30 
07:08]:
> 
> > On Oct 29, 2016, at 22:35, meino.cra...@gmx.de wrote:
> > 
> > 
> > Hi John,
> > 
> > 
> > from my racket 6.6 installation ($HOME):
> > 
> > :user/.racket>l
> > total 20
> > drwxr-xr-x 5 user users 4096 2016-10-21 05:25 6.6
> > drwxr-xr-x 5 user users 4096 2016-10-30 06:21 6.7
> > drwxr-xr-x 2 user users 4096 2016-10-30 06:21 download-cache
> > -rw-r--r-- 1 user users 5254 2016-10-30 06:25 racket-prefs.rktd
> > :user/.racket>cd 6.6
> > :.racket/6.6>l
> > total 16
> > drwxr-xr-x 5 user users 4096 2016-10-21 05:26 doc
> > -rw-r--r-- 1 user users   91 2016-10-21 05:25 links.rktd
> > drwxr-xr-x 5 user users 4096 2016-10-21 05:25 pkgs
> > drwxr-xr-x 2 user users 4096 2016-10-21 05:25 share
> > :.racket/6.6>cd pkgs
> > :6.6/pkgs>l
> > total 16
> > drwxr-xr-x 4 user users 4096 2016-10-21 05:25 csv-reading
> > drwxr-xr-x 4 user users 4096 2016-10-21 05:25 mcfly
> > drwxr-xr-x 4 user users 4096 2016-10-21 05:25 overeasy
> > -rw-r--r-- 1 user users  373 2016-10-21 05:25 pkgs.rktd
> > :6.6/pkgs>
> > 
> > so I thought, that there must be a cvs-reading-pkg in 6.7
> > too…
> 
> hang on, look closely:
> 
> CSV-reading
> vs
> CVS-reading
> 
> not the same.
> 
> There is a csv-reading package. There is not a cvs-reading package.
> 
> Right?
> 
> Apologies if I’m misunderstanding you somehow. Or if auto-correct is making 
> your life terrible :).
> 
> John Clements
> 
> 
> -- 
> 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.com.
> For more options, visit https://groups.google.com/d/optout.


-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] cvs-reading ?

2016-10-29 Thread Meino . Cramer

Hi John,


from my racket 6.6 installation ($HOME):

:user/.racket>l
total 20
drwxr-xr-x 5 user users 4096 2016-10-21 05:25 6.6
drwxr-xr-x 5 user users 4096 2016-10-30 06:21 6.7
drwxr-xr-x 2 user users 4096 2016-10-30 06:21 download-cache
-rw-r--r-- 1 user users 5254 2016-10-30 06:25 racket-prefs.rktd
:user/.racket>cd 6.6
:.racket/6.6>l
total 16
drwxr-xr-x 5 user users 4096 2016-10-21 05:26 doc
-rw-r--r-- 1 user users   91 2016-10-21 05:25 links.rktd
drwxr-xr-x 5 user users 4096 2016-10-21 05:25 pkgs
drwxr-xr-x 2 user users 4096 2016-10-21 05:25 share
:.racket/6.6>cd pkgs 
:6.6/pkgs>l
total 16
drwxr-xr-x 4 user users 4096 2016-10-21 05:25 csv-reading
drwxr-xr-x 4 user users 4096 2016-10-21 05:25 mcfly
drwxr-xr-x 4 user users 4096 2016-10-21 05:25 overeasy
-rw-r--r-- 1 user users  373 2016-10-21 05:25 pkgs.rktd
:6.6/pkgs>

so I thought, that there must be a cvs-reading-pkg in 6.7
too...

?

Cheers
Meino

John Clements  [16-10-30 06:28]:
> 

> > On Oct 29, 2016, at 20:08, meino.cra...@gmx.de wrote:

> > 

> > Hi,

> > 

> > While using racket 6.6 I installed the package 'cvs-reading' in $HOME

> > with 'raco pkg install cvs-reading' as me (not as root).

> 

> Did you mean to write ‘csv-reading’ ? I don’t see a package named cvs-reading.

> 

> John Clements

> 

> > 

> > Now, after updateing to racket 6.7, this package cannot longer

> > be 'require'd :

> >> (require cvs-reading)

> > ; readline-input:1:9: collection not found

> > ;   for module path: cvs-reading

> > ;   collection: "cvs-reading"

> > ;   in collection directories:

> > ;/home/mccramer/.racket/6.7/collects

> > ;/usr/local/share/racket/collects

> > ;... [156 additional linked and package directories]

> > ; [,bt for context]

> > 

> > According to that output, all packages installed prior

> > to racket 6.7 are now no longer available since installed

> > under

> >/home/mccramer/.racket/6.7/collects

> > (that is: not version independantly).

> > 

> > Forthermore:

> > Repeating the above command

> >raco pkg install cvs-reading

> > 

> > fails with:

> >Resolving "cvs-reading" via 
> > https://download.racket-lang.org/releases/6.7/catalog/

> >Resolving "cvs-reading" via https://pkgs.racket-lang.org

> >Resolving "cvs-reading" via https://planet-compats.racket-lang.org

> >raco pkg install: cannot find package on catalogs

> >package: cvs-reading

> >[1]29873 exit 1 raco pkg install cvs-reading

> > 

> > 

> > Suppose I had installed 20 instead of only one package...

> > Do I need to reinstall all packages when upgrading racket (hopefully

> > not)...?

> > How can I reanimate my sources, which depends on 'cvs-reading'?

> > 

> > Cheers,

> > Meino

> > 

> > 

> > --

> > 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.com.

> > For more options, visit https://groups.google.com/d/optout.

> 

> 


-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: cvs-reading ?

2016-10-29 Thread Meino . Cramer

Hi Jack,

thanks fpr your reply ! :)

I tried that with this script (copied from the docs, "/bin/env racket
replace by the actually path to racket):

#!/usr/local/bin/racket; \
#lang scripty  ; | script preamble
#:dependencies '("cvs-reading"); /
--
#lang racket

(require cvs-reading)

and it failed with:

default-load-handler: cannot open module file
module path: #
path: /home/mccramer/; \
system error: No such file or directory; errno=2
context...:
standard-module-name-resolver
[1]32658 exit 1 ./test.rkt

What did I wrong here?

Cheers
Meino

Jack Firth  [16-10-30 06:08]:
> I would recommend adding `info.rkt` files to your projects so that your 
> projects are *themselves* packages. In these info files you can declare what 
> packages you depend on, so rather than manually installing dependencies one 
> at a time globally (and reinstalling when upgrading racket), you simply 
> install your project as a package and `raco pkg` will fetch all the 
> dependencies you listed.
> 
> If you're writing things that tend to be one-off scripts rather than 
> full-blown projects and the overhead of an `info.rkt` file irks you, have a 
> look at Scripty[1]. This is a Racket package that lets you write scripts that 
> declare what packages they depend on in the script itself -- when you run the 
> script, it prompts you to install any declared packages that aren't present. 
> It's especially useful for replacing random shell scripts with racket scripts 
> without forcing your coworkers to confront the racket packaging system.
> 
> [1] http://docs.racket-lang.org/scripty/index.html
> 
> -- 
> 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.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] cvs-reading ?

2016-10-29 Thread Meino . Cramer
Hi,

While using racket 6.6 I installed the package 'cvs-reading' in $HOME
with 'raco pkg install cvs-reading' as me (not as root).

Now, after updateing to racket 6.7, this package cannot longer
be 'require'd :
> (require cvs-reading)
; readline-input:1:9: collection not found
;   for module path: cvs-reading
;   collection: "cvs-reading"
;   in collection directories:
;/home/mccramer/.racket/6.7/collects
;/usr/local/share/racket/collects
;... [156 additional linked and package directories]
; [,bt for context]

According to that output, all packages installed prior
to racket 6.7 are now no longer available since installed
under 
/home/mccramer/.racket/6.7/collects
(that is: not version independantly).

Forthermore:
Repeating the above command
raco pkg install cvs-reading

fails with:
Resolving "cvs-reading" via 
https://download.racket-lang.org/releases/6.7/catalog/
Resolving "cvs-reading" via https://pkgs.racket-lang.org
Resolving "cvs-reading" via https://planet-compats.racket-lang.org
raco pkg install: cannot find package on catalogs
package: cvs-reading
[1]29873 exit 1 raco pkg install cvs-reading


Suppose I had installed 20 instead of only one package...
Do I need to reinstall all packages when upgrading racket (hopefully
not)...?
How can I reanimate my sources, which depends on 'cvs-reading'?

Cheers,
Meino


-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] How to 'apply' a function with optional parameters?

2016-10-29 Thread Meino . Cramer
Hi all,

...think, I have to apologize

I screwed it upit is a language (spoke one...not "programming" )
thing:
I read "List of strings" which in german is "Liste von Zeichenketten".
THIS expression means this:
"A" "B" "C"
(for example).
This applied to string-join in a germenglish head forms:
(string-join "A" "B" "C" "seperator")
But I had
(define lst (list "A" "B" "C"))
(string-join lst "seperator")

...so I thougt I need an "apply" to move the
string-join right in front of the "list of strings" (spoken language)
in the list of strings (racket-speak).

But despite of the nonsense I thought I now have learned
how to handle functions with additional arguments in case
of the need to 'apply' them. 
Thanks a lot Shu-Hung, for you help and the patience of all
who wanted de-confuse me ;)

(THANKS!)

Cheers,
Meino


Shu-Hung You  [16-10-29 18:08]:
> Hi Meino,
> 
> Could you give an example of lst or line? Unlike string-append, most of the 
> time
> string-join doesn't really require an 'apply'. As we can see:
> 
> > (string-append "a" "b" "c")
> "abc"
> > (string-join '("a" "b" "c") ":")
> "a:b:c"
> 
> While string-append takes all its arguments and concatenates them into a 
> string,
> string-join simply joins all the strings in its first argument (which
> should be a list of strings).
> So suppose we have 'line' to be a list of string, then string-append
> and string-join can
> be used as follows:
> 
> > (define line '("x" "y" "z"))
> > (apply string-append line)
> "xyz"
> > (string-join line " ")
> "x y z"
> 
> If string-join is really to be used with apply, then we need to first
> construct its arguments
> into a list. For instance, the first of example of string-join is turned into:
> 
> > (string-join '("a" "b" "c") ":")
> "a:b:c"
> > (apply string-join '(("a" "b" "c") ":"))
> "a:b:c"
> 
> Given 'line' to be a list of strings, we need to construct the
> separator as the second item in
> the argument list of string-join:
> 
> > (define line '("x" "y" "z"))
> > (apply string-join (list line " "))
> "x y z"
> 
> Best,
> Shu-Hung
> 
> On Sat, Oct 29, 2016 at 10:31 AM,   wrote:
> >
> > Hi Stephen,
> >
> > thanks for yoru reply ! ::)
> >
> > At the certain point of the program I get
> > a list as parameter 'lst', which contains
> > the sublists of strings. I wrote this
> > function:
> >
> >
> > (define (to-txt lst)
> >   (if (empty? lst)
> > lst
> > (let ((line (car lst)))
> >   (begin
> > (displayln (apply string-join line " " )) ;;; WRONG SYNTAX HERE
> > (to-txt (cdr lst))
> >
> > Since I get the sublists as parameters I need an 'apply' to 'inject'
> > (sorry...I am no native speaker...) 'string-join' into the list.
> >
> > But string-join has additional parameters, and I dont know how to
> > combine those with 'apply'?
> >
> > PS: The resulting strings will later be processed further... the
> > 'displayln' is just a placeholder...
> >
> > Cheers,
> > Meino
> >
> >
> > Stephen Chang  [16-10-29 17:16]:
> >> string-join already expects a list of strings, so are you sure you want 
> >> apply?
> >> Can you give a more specific example?
> >>
> >> Perhaps map or some other iteration is what you want?
> >>
> >> (for ([strs '(("a" "b") ("c" "D" "E"))])
> >>   (displayln (string-join strs " ")))
> >>
> >> =>
> >> a b
> >> c D E
> >>
> >> On Sat, Oct 29, 2016 at 10:27 AM,   wrote:
> >> > Hi,
> >> >
> >> > ...still improving my shortwave-broadcaster-dumper... :)
> >> >
> >> > I have a list with sublists of strings, which I want to concatenate.
> >> > Each sublist shall form one line of output.
> >> > I tried 'string-append', but this gives me something like this
> >> > (excerpt):
> >> > "189RikisutvarpidRas1+2-24001234567Icelandic"
> >> > ...the separating #\space is missing.
> >> >
> >> > The according code looks like this (excerpt)
> >> >
> >> > (apply string-append sublist)
> >> >
> >> > then I found 'string-join' which has extra-parameters
> >> > to define separator of all kinds.
> >> >
> >> > ...but...how can I express the 'apply'-instruction...with the
> >> > addional parameters???
> >> >
> >> > This looks something inbetween funny and weird:
> >> >
> >> > (apply string-join sublist " ")
> >> >
> >> > and racket mumbles:
> >> > apply: contract violation
> >> >   expected: list?
> >> >   given: " "
> >> >   argument position: 3rd
> >> >   other arguments...:
> >> >#
> >> >
> >> >
> >> > ?
> >> >
> >> > Cheers
> >> > Meino
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > --
> >> > 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.com.
> >> > For more options, visit https://groups.google.com/d/optout.
> >>
> >> --
> >> You received this message because you are subscribed to the Google Groups 
> >> 

Re: [racket-users] How to 'apply' a function with optional parameters?

2016-10-29 Thread Meino . Cramer

Hi Stephen,

thanks for yoru reply ! ::)

At the certain point of the program I get
a list as parameter 'lst', which contains
the sublists of strings. I wrote this
function:


(define (to-txt lst)
  (if (empty? lst)
lst
(let ((line (car lst)))
  (begin
(displayln (apply string-join line " " )) ;;; WRONG SYNTAX HERE
(to-txt (cdr lst))

Since I get the sublists as parameters I need an 'apply' to 'inject'
(sorry...I am no native speaker...) 'string-join' into the list.

But string-join has additional parameters, and I dont know how to
combine those with 'apply'?

PS: The resulting strings will later be processed further... the
'displayln' is just a placeholder...

Cheers,
Meino


Stephen Chang  [16-10-29 17:16]:
> string-join already expects a list of strings, so are you sure you want apply?
> Can you give a more specific example?
> 
> Perhaps map or some other iteration is what you want?
> 
> (for ([strs '(("a" "b") ("c" "D" "E"))])
>   (displayln (string-join strs " ")))
> 
> =>
> a b
> c D E
> 
> On Sat, Oct 29, 2016 at 10:27 AM,   wrote:
> > Hi,
> >
> > ...still improving my shortwave-broadcaster-dumper... :)
> >
> > I have a list with sublists of strings, which I want to concatenate.
> > Each sublist shall form one line of output.
> > I tried 'string-append', but this gives me something like this
> > (excerpt):
> > "189RikisutvarpidRas1+2-24001234567Icelandic"
> > ...the separating #\space is missing.
> >
> > The according code looks like this (excerpt)
> >
> > (apply string-append sublist)
> >
> > then I found 'string-join' which has extra-parameters
> > to define separator of all kinds.
> >
> > ...but...how can I express the 'apply'-instruction...with the
> > addional parameters???
> >
> > This looks something inbetween funny and weird:
> >
> > (apply string-join sublist " ")
> >
> > and racket mumbles:
> > apply: contract violation
> >   expected: list?
> >   given: " "
> >   argument position: 3rd
> >   other arguments...:
> >#
> >
> >
> > ?
> >
> > Cheers
> > Meino
> >
> >
> >
> >
> >
> > --
> > 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.com.
> > For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> 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.com.
> For more options, visit https://groups.google.com/d/optout.
> 

-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: How to 'apply' a function with optional parameters?

2016-10-29 Thread Meino . Cramer
Hi Ken,

thanks for your reply ! :)

The problem is much "simpler"... :)

You wrote the whole logic to dig into the strings in the sublists in
the big list.
That's already done and working

I am in search for doing this

(string-join '( "a" "b" "c") " " )  ;; ( "a" "b" "c") is the sublist

but in the context of apply:
(define (to-txt lst)
  (if (empty? lst)
lst
(let ((line (car lst)))
  (begin
(displayln (apply string-join line " ")) ;; THIS IS THE WRONG SYNTAX!!!
(to-txt (cdr lst))

...and printing the lines is only a intermediate resultthe joined
strings will be processed further in a later stage of this program.
That's why I need a complete string with separators.

Cheers
Meino





Ken MacKenzie  [16-10-29 16:48]:
> Not 100% sure of what you're asking so if I got this wrong pseudo code it for 
> me.  Remember I am kind of new to racket but I will give it a go:
> 
> As I understand it you have a list of lists of strings perhaps like this...
> 
> (('this' 'is' 'one')('this' 'is' 'another')('this' 'is' 'the' 'last'))
> 
> and you want to output as such
> 
> this is one
> this is another
> 
> this is the last
> 
> 
> Ok so here is how I would do this
> 
> I will write this as 2 functions, from your main code you call the first 
> passing it ...
> 
> big-list = the whole list of lists
> 
> ;;in main loop
> (per-line big-list)
> 
> (define (per-line blist)
>   (cond
> [(empty? blist) #f]
> [else
>   (per-item (first blist))
>   (newline)
>   (per-line (rest blist))]))
> 
> (define (per-item slist)
>   (cond
> [(empty? slist) #f]
> [else
>   (display (first slist))
>   (display " ")
>   (per-item (rest slist))]))
> 
> That should be about it.  Double check me an ide about matched parens and 
> brackets.  I just eyeballed this real quick in the message.  But that is the 
> approach I would take for a simple proof.
> 
> An alternate approach is per-item accepts a string argument and returns the 
> string to per-line to display.  But if the end goal is quick output this is a 
> bout as concise + readable as I think I can make it.
> 
> Ken
> 
> 
> On Saturday, October 29, 2016 at 10:27:09 AM UTC-4, meino.cramer wrote:
> > Hi,
> > 
> > ...still improving my shortwave-broadcaster-dumper... :)
> > 
> > I have a list with sublists of strings, which I want to concatenate.
> > Each sublist shall form one line of output.
> > I tried 'string-append', but this gives me something like this
> > (excerpt):
> > "189RikisutvarpidRas1+2-24001234567Icelandic"
> > ...the separating #\space is missing.
> > 
> > The according code looks like this (excerpt)
> > 
> > (apply string-append sublist)
> > 
> > then I found 'string-join' which has extra-parameters
> > to define separator of all kinds.
> > 
> > ...but...how can I express the 'apply'-instruction...with the 
> > addional parameters???
> > 
> > This looks something inbetween funny and weird:
> > 
> > (apply string-join sublist " ")
> > 
> > and racket mumbles:
> > apply: contract violation
> >   expected: list?
> >   given: " "
> >   argument position: 3rd
> >   other arguments...:
> >#
> > 
> > 
> > ?
> > 
> > Cheers
> > Meino
> 
> -- 
> 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.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] How to 'apply' a function with optional parameters?

2016-10-29 Thread Meino . Cramer
Hi,

...still improving my shortwave-broadcaster-dumper... :)

I have a list with sublists of strings, which I want to concatenate.
Each sublist shall form one line of output.
I tried 'string-append', but this gives me something like this
(excerpt):
"189RikisutvarpidRas1+2-24001234567Icelandic"
...the separating #\space is missing.

The according code looks like this (excerpt)

(apply string-append sublist)

then I found 'string-join' which has extra-parameters
to define separator of all kinds.

...but...how can I express the 'apply'-instruction...with the 
addional parameters???

This looks something inbetween funny and weird:

(apply string-join sublist " ")

and racket mumbles:
apply: contract violation
  expected: list?
  given: " "
  argument position: 3rd
  other arguments...:
   #


?

Cheers
Meino





-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Print...a newbies problem ;)

2016-10-29 Thread Meino . Cramer
Hi,

currently I am still doing old-school "printf()-debugging", knowing
that it's '(print arg)' rather than 'printf( fmt, val,...);". :)

Since my program reads a bigger textfile of shortwave broadcasters,
their frequencies, on-air times, etc, reformats the whole thing
and (currently only to proof, everything is correct) prints it.

Since I need to now, where strings are starting and ending, I am using
'print' for that rather than 'pretty-print' or 'display'.

I am doing all this on UNIX/Linux.

To give myself a chance of reading the output I do this

racket shwrefmt.rkt | vim -

which reads everything, which goes to stdout into vim.

As long as I am using 'display', everything is fine.
When using 'print' the output mutates to smoke and vanishes in the pipe -
Vim starts with nothing to show.
'print'ing to the console works fine, though.

Giving at the REPL
> (current-output-port)
it says
#

which looks like the good-old STDOUT of UNIX to me...

Where is the output gone? <>

Thanks a lot for any help in advance!
Cheers,
Meino





-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Racket builds for ARM?

2016-10-28 Thread Meino . Cramer
Matthew Flatt  [16-10-28 05:04]:
> If ARMBIAN and Raspbian are compatible, then you could try the Utah
> snapshot site's Raspbian build:
> 
>   http://www.cs.utah.edu/plt/snapshots/
> 
> At Fri, 28 Oct 2016 03:21:49 +0200, meino.cra...@gmx.de wrote:
> > Hi,
> > 
> > after putting Racket on my desktop Linux box and on my tablet
> > (ARCHLinux chroot, x86 CPU) I want to put Racket on my Orange PI
> > PC (which is a Raspberry Pi inspired SoC-Computer). This Orange
> > Pi PC runs a " ARMBIAN Debian GNU/Linux 8 (jessie) 3.4.112-sun8i"
> > The CPU is (according to /proc/cpuingo) a
> > ARMv7 Processor rev 5 (v7l).
> > 
> > ARMBIAN only offers a (according to 'apt search racket')
> > racket/stable 6.1-4 armhf.
> > 
> > Is there any source known, which offers recent builds for this
> > platform?
> > 
> > Thanks a lot for any help!
> > Cheers,
> > Meino
> > 
> > -- 
> > 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.com.
> > For more options, visit https://groups.google.com/d/optout.
> 


Hi @all!

Thanks to all the help of the friendly people of this list
now my GENTOO Linux PC, my tablet and my Orange PI PC are 
successfully "racketificated" :)

(GREAT)

Cheers,
Meino




-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Racket builds for ARM?

2016-10-27 Thread Meino . Cramer
Hi Matthew,

thanks fpr your reply! :)

I received a recipe how to modify the configuration
of the ARMBIAN to pull from "unstable" source.
"Unstable" includes racket 6.6 (and hopfully 6.7
soon) -- I think those "unstable" sources are of
Raspbian... :)
Still downloading/updateingfingers crossed...

Cheers,
Meino



Matthew Flatt  [16-10-28 05:04]:
> If ARMBIAN and Raspbian are compatible, then you could try the Utah
> snapshot site's Raspbian build:
> 
>   http://www.cs.utah.edu/plt/snapshots/
> 
> At Fri, 28 Oct 2016 03:21:49 +0200, meino.cra...@gmx.de wrote:
> > Hi,
> > 
> > after putting Racket on my desktop Linux box and on my tablet
> > (ARCHLinux chroot, x86 CPU) I want to put Racket on my Orange PI
> > PC (which is a Raspberry Pi inspired SoC-Computer). This Orange
> > Pi PC runs a " ARMBIAN Debian GNU/Linux 8 (jessie) 3.4.112-sun8i"
> > The CPU is (according to /proc/cpuingo) a
> > ARMv7 Processor rev 5 (v7l).
> > 
> > ARMBIAN only offers a (according to 'apt search racket')
> > racket/stable 6.1-4 armhf.
> > 
> > Is there any source known, which offers recent builds for this
> > platform?
> > 
> > Thanks a lot for any help!
> > Cheers,
> > Meino
> > 
> > -- 
> > 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.com.
> > For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> 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.com.
> For more options, visit https://groups.google.com/d/optout.
> 

-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Racket builds for ARM?

2016-10-27 Thread Meino . Cramer
Hi,

after putting Racket on my desktop Linux box and on my tablet
(ARCHLinux chroot, x86 CPU) I want to put Racket on my Orange PI
PC (which is a Raspberry Pi inspired SoC-Computer). This Orange
Pi PC runs a " ARMBIAN Debian GNU/Linux 8 (jessie) 3.4.112-sun8i"
The CPU is (according to /proc/cpuingo) a
ARMv7 Processor rev 5 (v7l).

ARMBIAN only offers a (according to 'apt search racket')
racket/stable 6.1-4 armhf.

Is there any source known, which offers recent builds for this
platform?

Thanks a lot for any help!
Cheers,
Meino

-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Creating a list of random things

2016-10-25 Thread Meino . Cramer
Hi,

I want to create a list of random strings.
For that I have created a function, which returns a string
of random length and random contents.

Then I used 
make-list n (make-random-string)

to create that listand get back a list filled with n
identical strings.

h...

make-list calls make-random-string ones and the rest
is repetition.

If I think to have understood correctly for-loops and such are
somehow of "imperative, non-functional old-school programming style"
and map/apply and friends are the tools of the real racket programmer
;) this lead to a more general "problem" ("problem" only for a newbie
like me may be)...:

Since make-list calls its list-argument only once, the above does not
work in the sense it is wanted, so make-list creates only lists of
the same thing.

Therefore to prevent "for" and friends, I have to call make-list
with the empty list as list-argument and then map the 
make-random-string to each of them, which ensures that
make-random-string is not called once.
That feels ugly.

What is a good "racket-ish" of "racket-y" way (nothing negative
meant...just a play with words by someone, who is no native 
speaker...;) to do something n times without old-school
for-and-friends-loops.

Here is the code:

#lang racket
(require racket/random)
(require racket/string)

(define charseq "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" )
(define minchars  7)
(define maxchars 15)
(define numlists 6)

(define (make-random-string seq min max)
  ( let ((lenstr (random min max)))
( apply string (random-sample seq lenstr

(define (make-list-of-random-strings cnt seq min max )
  (make-list cnt (make-random-string seq min max )))

(define (make-list-of-lists numsublists)
  ( make-list numsublists (make-list-of-random-strings numlists charseq 
minchars maxchars)))

( define (main)
 (make-list-of-lists 20))

(main)

Any improvement is welcome!

Cheers,
Meino



-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] raco run but (please) dont process the docs

2016-10-23 Thread Meino . Cramer
Asumu Takikawa  [16-10-23 18:12]:
> Hi Meino,
> 
> On 2016-10-23 11:09:48 +0200, meino.cra...@gmx.de wrote:
> > It there any way to tell raco what kind
> > of doc processing is wanted and what don't?
> 
> In addition to Daniel's answer, there is a temporary workaround you can do 
> which
> is to install a package with the --no-setup flag like this:
> 
>   raco pkg install --no-setup 
>   raco setup -D
> 
> the -D flag to setup tells it to avoid building docs.
> 
> Cheers,
> Asumu
> 
Hi Asumu,

 OH GREAT ! :)
 Now I will be able to do racket programming on
 my little tablet while commuting to and from work home!

 (NICE)

 :)

 Thanks a lot for that info, Asumu.
 Cheers,
 Meino


-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] n things in one go and: How to search for something unkown?

2016-10-23 Thread Meino . Cramer
Hi,


A more general question:
I am no native english speaker and a newbie when it
comes to Racker/Lisp/Functional programming.

Suppose I want the name of a function or functionality
(like this genious 'apply map' algorithm to hurry through
a list of lists) - how/where can I search for it if I
cannot name it?

Is there a 'Racket Cookbook' like the 'Perl Cookbook' somewhere
or something similiar?

(Cheers)
Meino






-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] raco run but (please) dont process the docs

2016-10-23 Thread Meino . Cramer
Hi,

I have installed racket on my Android tablet.
For this I have the device rooted
and installed a chrooted Archlinux,
which in turn provides the prebuild
racket-package 6.6.
By the way: The tablet has a x86 iIntel CPU
but nothing "big iron"-like. About 400MB
free RAM is available.

BUT:
When I install an additional package like csv-reading
via raco pkg install it also processes the scribble
docs to pdf via TeX of that package.
And that's much too much for my little tablet.
It instantly kills the terminal app and resets.

It there any way to tell raco what kind
of doc processing is wanted and what don't?

Cheers,
Meino



-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Funtional programming and the maximum of something

2016-10-22 Thread Meino . Cramer
Hi,

(I am still a newbie ... )

If I remember  one rule of functional programming
correctly, it says: 
Instead of changeing data - create new data.

Suppose I have a list of list. Each "sublist" is 
made of a greater amount (but identical count) of 
exact numbers (integers).

I want to process these data recursively and if
all is done I want to get back a list of numbers
(same count of numbers as in each sublist), which
represents the maximum of all numbers of that "position"
in all sublists.

If I want to make this purely (may be inpractical) functional,..
I see (as a newbie) the following problem.
>From two numbers as input I have to build a maximum and
have to feed that into the next circle of recursion as
one of the numbers to compare.
Each time a new maximum is found I have to overwrite the
old one.
This contradicts the rule "Dont change data, create new one."

How can I get out of this?

Cheers
Meino




-- 
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.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] First posting to Racket User List / question

2016-10-17 Thread Meino . Cramer
Hi,

this is my first posting to the racket users list. 
Is this the right place to post questions of a 
very beginner to racket programming (and lispy
programming)?

Best regards,
Meino


-- 
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.com.
For more options, visit https://groups.google.com/d/optout.