The words you’re actually looking for are “statically typed” and “dynamically typed.”

Scheme is “dynamically typed.” Some people use the words “strongly typed” to refer to the phenomena that variables must be explicitly converted to another type to be used in a different context. Eg, a string cannot be added to an integer without explicit conversion of one of those to the other.

Maybe seek definitions for these things before making inflammatory comments in the future?

Cheers,

apg

On Sep 20, 2022, at 14:44, Jacob Hrbek <kreyren@rixotstudio.cz> wrote:


In what world is this considered a strongly typed language when I need to do these checks like it's a weakly typed one?

    (define* (lazy-assign key #:optional (val ""))
      "Assign environmental variable KEY with an optional value VAL, both  must be a string or a thunk that evaluates to a string

    This procedure sets an entry in the @{%makevars} hash table"

      (cond ((procedure? key)
    (set! key (key)))
    ((string? key)
    ;; FIXME-QA(Krey): Seems like a wasteful @{format}
    (set! key (format #f "~a" key)))
    ;; FIXME-QA(Krey): Make sure that the error here is clear and descriptive
    (else (make-non-continuable-error)))

      ;; FIXME-QA(Krey): Add check for sanity of VAL

      (makevars-set key (delay val)))

Instead of something like:

  (define* (lazy-assign (string-type key) #:optional (val ""))
  "Assign environmental variable KEY with an optional value VAL, both must be a string or a thunk that evaluates to a string

  This procedure sets an entry in the @{%makevars} hash table"

  (makevars-set key (delay val)))

Notice the (string-type key) meant to declare that it's only expecting an input that is a string or evaluates into a string which mitigates the need to include sanity checking in every procedure..

or even something like:

    (define* (lazy-assign key:string #:optional (var:string "")) ...)

-- Jacob "Kreyren" Hrbek