unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andrew Gwozdziewycz <apgwoz@gmail.com>
To: Jacob Hrbek <kreyren@rixotstudio.cz>
Cc: guile-devel@gnu.org
Subject: Re: Strongly typed language my ass
Date: Tue, 20 Sep 2022 15:17:19 -0700	[thread overview]
Message-ID: <80B363AB-2881-493B-800E-7F0ABF21F033@gmail.com> (raw)
In-Reply-To: <3izAWevitpu2Y1OBwQnrCwhVv4CePmVfWKxl-0oCg1yBwy1TfQcHwbHBUk9iNaZcK5WYKxmxebrZpwXAK5qM3s36qWzc1UBHH2D2XbB3jJ0=@rixotstudio.cz>

[-- Attachment #1: Type: text/plain, Size: 2088 bytes --]

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

[-- Attachment #2.1: Type: text/html, Size: 3550 bytes --]

[-- Attachment #2.2: publickey - kreyren@rixotstudio.cz - 0x1677DB82.asc --]
[-- Type: application/octet-stream, Size: 661 bytes --]

-----BEGIN PGP PUBLIC KEY BLOCK-----

xjMEYAl3FhYJKwYBBAHaRw8BAQdAQKApmdR8tG9aKEdxwHJ/ZKO2CvZMRWPt
BNNGqJUhp2LNL2tyZXlyZW5Acml4b3RzdHVkaW8uY3ogPGtyZXlyZW5Acml4
b3RzdHVkaW8uY3o+wo8EEBYKACAFAmAJdxYGCwkHCAMCBBUICgIEFgIBAAIZ
AQIbAwIeAQAhCRCt030Uq0L8qRYhBBZ324KTjKhlc4EjB63TfRSrQvyp57QA
/0tlbdnCIzreKXmvW2XSYXzAJotJdxCzE+XATM+qPDKzAQCcbHp7yw6+Arng
eStGFn/olhxTPdpu641CLGigPmEoBc44BGAJdxYSCisGAQQBl1UBBQEBB0Da
iI3jQfSoi3DZ4/NfmxGdsRsv9/BqMgW5j6jdBqkyIAMBCAfCeAQYFggACQUC
YAl3FgIbDAAhCRCt030Uq0L8qRYhBBZ324KTjKhlc4EjB63TfRSrQvypHcEB
AOQxS/J/UM0ee8k2jbliWd/Q0Id+X8UHBXhyqVRc22qrAQDLHcW97WQbSJFo
19kwt70OyHepF6LWpDD0PuISZD6ICg==
=9kZg
-----END PGP PUBLIC KEY BLOCK-----

[-- Attachment #2.3: Type: text/html, Size: 178 bytes --]

      parent reply	other threads:[~2022-09-20 22:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-20  9:01 Strongly typed language my ass Jacob Hrbek
2022-09-20 21:58 ` Jean Abou Samra
2022-09-20 22:17 ` Andrew Gwozdziewycz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=80B363AB-2881-493B-800E-7F0ABF21F033@gmail.com \
    --to=apgwoz@gmail.com \
    --cc=guile-devel@gnu.org \
    --cc=kreyren@rixotstudio.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).