public inbox for
 help / color / mirror / Atom feed
From: Per Bothner <>
To: Duncan Mak <>,
	kawa mailing list <>
Subject: Re: Disambiguate method from function
Date: Wed, 16 Dec 2020 02:59:01 -0800	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On 12/16/20 12:49 AM, Duncan Mak via Kawa wrote:
> This doesn't work because I think it gets confused between hello the method
> and hello the function:
> test.scm:3:4: call to 'hello' has too many arguments (1; must be 0)
> I could of course resolve this by renaming 'hello' the function to
> something like 'hello*', but is there another way to disambiguate the two?

Nothing I can think of to explicitly disambiguate.  (I tried some.)

I suggest using an alias:

(define-simple-class Person ()
    (%hello "Calling from method")))

(define (hello message) (format #t "~A~%" message))
(define-alias %hello hello)

(hello "Calling from function")

	--Per Bothner

      reply	other threads:[~2020-12-16 10:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-16  8:49 Duncan Mak
2020-12-16 10:59 ` Per Bothner [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:

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

  git send-email \ \ \ \ \

* 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).