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 for

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

2016-10-29 Thread Shu-Hung You
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 the

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

2016-10-29 Thread Pierpaolo Bernardi
On Sat, Oct 29, 2016 at 5:31 PM, wrote: > 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 > (di

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-

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

2016-10-29 Thread Ken MacKenzie
Yeah that is much more concise than mine. My newbie lack of knowledge on the stdlib is showing. Ken On Saturday, October 29, 2016 at 11:12:50 AM UTC-4, Stephen Chang wrote: > string-join already expects a list of strings, so are you sure you want apply? > Can you give a more specific example? >

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

2016-10-29 Thread Stephen Chang
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

[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"