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 7995229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:20:52+00:00 2026-06-04T14:20:52+00:00

Introduction As a developer, I’m involved in writing a lot of mathematical code everyday

  • 0

Introduction

As a developer, I’m involved in writing a lot of mathematical code everyday and I’d like to add very few syntactic sugar to the C# language to ease code writing and reviewing.

I’ve already read about this thread and this other one for possible solutions and would simply like to know which best direction to go and how much effort it may represent to solve only for the three following syntactical issues*.

*: I can survive without described syntactic sugars, but if it ain’t too much work and Rube-Goldberg design for simple compilation process, it may be interesting to investigate further.

1. Multiple output arguments

I’d like to write:

 [double x, int i] = foo(z);

Instead of:

 double x;
 int i;
 foo(out x, out i, z);

NB: out parameters being placed first and foo being declared as usual (or using same kind of syntax).

2. Additional operators

I’d like to have a few new unary/binary operators. Don’t know much how to define for these (and it seems quite complex for not introducing ambiguity when parsing sources), anyway would like to have something like:

namespace Foo
{
    using binary operator "\" as "MyMath.LeftDivide";
    using unary operator "'" as "MyMath.ConjugateTranspose";

    public class Test
    {
         public void Example()
         {
             var y = x';
             var z = x \ y;
         }
    }
}

Instead of:

namespace Foo
{
    public class Test
    {
         public void Example()
         {
             var y = MyMath.ConjugateTranspose(x);
             var z = MyMath.LeftDivide(x, y);
         }
    }
}

3. Automatic name insertion for static classes

It’s extremely unappealing to endlessly repeating Math.BlaBlaBla() everywhere in a computation code instead of writing directly and simply BlaBlaBla.

For sure this can be solved by adding local methods to wrap Math.BlaBlaBla inside computation class. Anyway would be better when there’s no ambiguity at all, or when ambiguity would be solved with some sort of implicit keyword, to automatically insert class names when required.

For instance:

using System; 
using implicit MySystem; // Definying for 'MyMaths.Math.Bessel'

public class Example
{
    public Foo()
    {
        var y = 3.0 * Cos(12.0); 
        var z = 3.0 * Bessel(42);
    }

    // Local definition of 'Bessel' function again
    public static double Bessel(double x)
    {
        ...
    }
}

Would become:

using System; 
using MySystem; // Definying for 'Math.Bessel'

public class Example
{
    public Foo()
    {
        var y = 3.0 * System.Math.Cos(12.0); // No ambiguity at all 
        var z = 3.0 * MySystem.Math.Bessel(42); // Solved from `implicit` keyword 
    }

    // Local definition of 'Bessel' function again
    public static double Bessel(double x)
    {
        ...
    }
}

* The compiler may simply generate a warning to indicate that it solved the ambiguity because an implicit solution has been defined.

NB: 3) is satisfying enough for solving 2).

  • 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-04T14:20:53+00:00Added an answer on June 4, 2026 at 2:20 pm

    I’d be one of the first people to support a mainstream C# that can be extended by users. However – for several reasons (design, time or cost-benefit) I cannot see C# being as extensible as you (or I) want. A C#-derived language I’ve found that is VERY good for meta-programming and extending functionality/syntax is Nemerle.

    Boo is another .NET language with good meta-programming features. However, it is so far removed from C# that I didn’t consider it an appropriate answer to this question (but added it for completeness, anyway).

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

Sidebar

Related Questions

Here is the link to the sample code http://developer.apple.com/library/ios/#samplecode/MVCNetworking/Introduction/Intro.html Below is the code snippet
The DocInteraction sample code made available by Apple at http://developer.apple.com/library/ios/#samplecode/DocInteraction/Introduction/Intro.html (download: http://developer.apple.com/library/ios/samplecode/DocInteraction/DocInteraction.zip ) does
I am looking at the 'Metronome' sample code from the iOS SDK ( http://developer.apple.com/library/ios/#samplecode/Metronome/Introduction/Intro.html
I have been playing around with Apple's sample code - UserDefaults - http://developer.apple.com/library/mac/#samplecode/UserDefaults/Introduction/Intro.html -
All, In Apple's sample code DateCell http://developer.apple.com/library/ios/#samplecode/DateCell/Introduction/Intro.html the ivar pickerView is declared in MyTableViewController.h
I want to create an app like CoreDataBooks example http://developer.apple.com/library/ios/#samplecode/CoreDataBooks/Introduction/Intro.html . My idea is,
I tried to use this code but it doesn't work. http://developer.apple.com/library/ios/#samplecode/PageControl/Introduction/Intro.html Ld /Users/waitonza/Library/Developer/Xcode/DerivedData/Dr_Ngoo-aanknxmuodcgjicaigxevljxokeq/Build/Products/Debug-iphonesimulator/Dr Ngoo.app/Dr
Introduction: Now I know this question could be very broad and it would be
I found the pre-release docs for this at https://developer.apple.com/iphone/prerelease/library/featuredarticles/FA_Wireless_Enterprise_App_Distribution/Introduction/Introduction.html (Developer account required) and some
I'd like to find a good, solid book, aimed at the skilled developer market,

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.