Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7982335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:39:07+00:00 2026-06-04T10:39:07+00:00

Context Suppose I have protocols ICursor, IFoo, IBar then I can have a function

  • 0

Context

Suppose I have protocols ICursor, IFoo, IBar then I can have a function named:

(defn IFoo->IBar [foo] ... )

Now, suppose I have a function which takes two arguments

x: ICursor
y: IFoo

and output an object of type IBar.

Now, is there any standard way to denote this in a function name? For example, none of the following work:

(defn ICursor,IFoo->IBar [x y] ...)

because “,” is treated as space

(defn (ICursor, IFoo)->IBar [x y] ... )

because () is treated as function application.

(defn [ICursor, IFoo]->IBar [x y] ... )

because [] is treated as vector.

Question

Is there a standard way to encode protocol types of arguments in the function name?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T10:39:09+00:00Added an answer on June 4, 2026 at 10:39 am

    I don’t think there is any such recommended way and it seems like sort of type annotations. There is one such project around giving type annotations to clojure code at this link.

    You can use something like : (defn ICursor->IFoo->IBar [x y] ...) which denotes that the function takes ICursor and IFoo as params and return IBar, so basically last type is return type and before that everything is parameter type but I am not sure if that can be a long term or idiomatic solution because then where is the method actual name 🙂 which is important then type annotation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have a function call from EF like: var result = context.myFunction(); the
I have created a library which can download JSON data which is then placed
Suppose I have a database named MyDatabase which has two tables - MyTable1 and
Suppose you have three objects you acquire via context manager, for instance A lock,
Suppose we have a Collection<Foo> . What is the best (shortest in LoC in
Suppose I have a context menu as a window resource: <Window.Resources> <ContextMenu x:Shared=false x:Key=ContextMenu>
Suppose I have a context that is configured similar to: Establish context = ()
Suppose I have: my $string = one.two.three.four; How should I play with context to
Suppose you have public class A { public string _myString; } And this context:
Suppose i have a class which extends ViewGroup public class MapView extends ViewGroup It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.