On Sat, Oct 29, 2016 at 5:31 PM, <meino.cra...@gmx.de> 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 > (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.
You missed this hint from Stephen Chang: "string-join already expects a list of strings, so are you sure you want apply?" As is the case, this hint was spot on. You don't need apply here,just remove it and your function should work. Also, the begin is not necessary (but it does no harm either). -- 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.