Quickscript competition ends Friday

24 views
Skip to first unread message

Stephen De Gabrielle

unread,
Jul 28, 2020, 11:59:26 AM7/28/20
to Racket Users
There are still prizes.
It is easy and fun.
Make DrRacket do what *you* want.


Stephen


Stephen De Gabrielle

unread,
Jul 29, 2020, 4:46:44 AM7/29/20
to Racket Users
Hi All, 

The example in the documentation is bad - it redefines 'reverse' (which is fine), then attempts to use it.

The working version changes the name of the script (which is just a function) to 'reverse-selection' so it doesn't cause the error:
 
(define-script reverse-selection
  #:label "Reverse"
  (λ (selection)
    (list->string (reverse (string->list selection)))))

I still think making scripts is easy and fun but I apologise for not testing the documentation.

here is a script I just made (and tested); 

#lang racket/base
;;; License: MIT/Apache2.0
(require browser/external
         quickscript)
(script-help-string "Racket Survey.")
(define-script racket-survey
  #:label "Racket Survey (browser)"
  #:menu-path ("&News")
  #:help-string "Complete the Racket Survey now"
  (λ (str) 
    #f))

click new script in the menu and give it a name 'survey' this will create a file 'survey.rkt' in the user scripts folder
paste in the above, save and click 'compile scripts and reload'. 
- you will find the script "Racket Survey (browser)" under 'News' in the scripts menu.

There is still time to enter and prizes to be won.

Stephen
Reply all
Reply to author
Forward
0 new messages