Skip to content

Instantly share code, notes, and snippets.

@PEZ
Last active October 13, 2024 21:08
Show Gist options
  • Save PEZ/60e1accc59d5c5783365ab46d47eb78b to your computer and use it in GitHub Desktop.
Save PEZ/60e1accc59d5c5783365ab46d47eb78b to your computer and use it in GitHub Desktop.
Hello World – Rich 4Clojure Problem 16 – See: https://github.com/PEZ/rich4clojure
(ns rich4clojure.elementary.problem-016
(:require [hyperfiddle.rcf :refer [tests]]))
;; = Hello World =
;; By 4Clojure user: dbyrne
;; Difficulty: Elementary
;;
;; Write a function which returns a personalized greeting.
(def __ :tests-will-fail)
(comment
)
(tests
(__ "Dave") := "Hello, Dave!"
(__ "Jenn") := "Hello, Jenn!"
(__ "Rhea") := "Hello, Rhea!")
;; To participate, fork:
;; https://github.com/PEZ/rich4clojure
;; Post your solution below, please!
@andrew-taxbit
Copy link

andrew-taxbit commented Aug 26, 2024

#(format "Hello, %s!" %)

@froucoux
Copy link

froucoux commented Oct 2, 2024

(def __ (fn greet [name] (str "Hello, " name "!")))

(def __ #(str "Hello, " % "!"))

@oezg
Copy link

oezg commented Oct 13, 2024

(def __ (partial format "Hello, %s!"))

(fn [who] (str "Hello, " who "!"))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment