Hacker News new | ask | show | jobs
by RaycatRakittra 2781 days ago
Looked really cool. Downloaded it via Homebrew but my first test file[1] ran into a myriad of issues like 'unbound variable: use', 'unbound variable: printf', 'import had trouble expanding the macro: srfi-1' (paraphrasing). Not sure if the Homebrew recipe is broken but I would love to use this for some of my side projects.

Congrats on the release!

[1] test.scm

(use srfi-1) (define (test number1 number2) (printf "Sum: ~s" (+ number1 number2))) (test 1 2)

1 comments

This is an old example. This should now be something like

(import (chicken format)) (define (test number1 number2) (printf "Sum: ~s" (+ number1 number2))) (test 1 2)

If you're trying to actually use srfi-1, that's now imported via (import srfi-1). (use...) no longer exists.

You can use two spaces at the beginning of the line to get code mode:

  ;(use srfi-1)                ; <-- old
  (import (chicken format))    ; <-- new 
  (define (test number1 number2)
    (printf "Sum: ~s" (+ number1 number2)))
  (test 1 2)
Gotcha! Thanks for the update.