public inbox for
 help / color / mirror / Atom feed
* Disambiguate method from function
@ 2020-12-16  8:49 Duncan Mak
  2020-12-16 10:59 ` Per Bothner
  0 siblings, 1 reply; 2+ messages in thread
From: Duncan Mak @ 2020-12-16  8:49 UTC (permalink / raw)
  To: kawa mailing list

Hello all,

I have some code like this,

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

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

(hello "Calling from function")
> ((Person):hello)

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?


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-16 10:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-16  8:49 Disambiguate method from function Duncan Mak
2020-12-16 10:59 ` Per Bothner

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