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

  • SEARCH
  • Home
  • 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 6543327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:19:59+00:00 2026-05-25T11:19:59+00:00

Simple question, I don’t think it’s possible but have been surprised before. I have

  • 0

Simple question, I don’t think it’s possible but have been surprised before.

I have a library with all kind of math functions, lets take a very simple example floorcap:

class MathLib {
    public static double floorcap(double floor, double value, double cap) {
        return Math.Min(Math.Max(floor, value), cap);
    }
}

In another method in another class, I’d like to just type

var mat_adjusted = floorcap(1, maturity, 5);

But that doesn’t work, because it’s not declared in this class, it’s in a library. It makes me type

var mat_adjusted = MathLib.floorcap(1, maturity, 5);

wich adds noise to the code. I could shorten it to

using m = MyMathLibrary.MathLib;

.. yadayada

var mat_adjusted = m.floorcap(1, maturity, 5);

but still, I’d prefer not to have to type the class name all the time. Is that possible? I write code in F# too and you kinda get used to not having to spell out the type/module etc after a while. When I have to write C# this thing annoys me (a little) because it distracts from the actaul ‘meat of the thing’.

There are a lot of functions here, when you need to call a few functions nested etc all these dots and class names add up. I like my code as clean as possible.

Thanks in advance,

Gert-Jan

  • 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-05-25T11:20:00+00:00Added an answer on May 25, 2026 at 11:20 am

    No, this isn’t possible – it has to be qualified to the extent of where it resides (obviously if the thing resides within scope of your current context, then you could, but that misses the point of the question and objective.)

    This is because nothing directly lives higher than any types etc, – so there is no sense of a “global call”, so to speak.

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

Sidebar

Related Questions

I think this is a relatively simple question, but I don't precisely know what's
I have a simple question, but don't seem to see the answer in a
I think that's a rather simple Question but I don't get it the way
very simple question here but I don't have the answer... ;-) I just need
This seems like a simple question, but the docs don't seem to have anything
I know this might ma a simple question, it must have been answered before
a simple question but I don't seem to have the right terminology to search
I have a very simple question, but I don't seem to get it right.
I think this is a simple question for you, but I don't understand other
Hopefully a simple question, but I don't have an iOS3 / device multitasking is

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.