What does `#:` mean in Guile?

421 views Asked by At

I normally use MIT/GNU Scheme, but found some Guile code in github (guile-2d).

(define main-menu
  (make-scene
   "Main Menu"
   #:init create-menu
   #:enter menu-enter
   #:exit menu-exit
   #:draw draw-menu
   #:update update-menu
   #:events `((key-down . ,menu-key-down))))

I first checked the MIT/GNU Scheme reference, which turned up additional notations, but that had nothing about #: in it.

I then glanced through the Guile manual, and found a few mentions (Profile Commands, Debugging Commands) that looked like it perhaps specified optional arguments? Something akin to this in Python:

def foo(test):
    return test

foo(bar="test")

Anyone know for sure what it means?

2

There are 2 answers

0
Óscar López On BEST ANSWER

That's just syntax for Guile's keyword arguments. Take a look at the documentation for more details.

0
D.Shawley On

That is the keyword argument syntax introduced by PLT Scheme 4.