Git Product home page Git Product logo

csharppluslittlethings's Introduction

CSharpPlusLittleThings

Bunch of cs utilities and usefull classes that anyone can use by just drag-in-drop The toolbox include:

EnumerationPlus.RangeList

Drop in extension compatible with Enumeration.Range, but with IList interface

  • Exports IList interface (read only) in addition to IEnumerable
  • All readers are 100% Thread safe
  • All readers and seeker operations are O(1), even IndexOf and Contains
  • Just use EnumerablePlus.RangeList instead of Enumerable.Range // drop-in replaceement

EnumerationPlus.RangeAsList

Add-on typed extension for our EnumerationPlus.RangeList that provides additional benefits:

  • Defined for all integer types from sbyte to ulong
  • All host type range support for Start parameter (but Count naturally restricted to Int32 by IList itself)
  • Suports RangeAsList(T Count) additional maker factory function to provide 0..Count-1 elements

FuncCall

Added function call argument-less clouse abstraction with parameters available externally. Use this class to encasulate closured function call : the function and its arguments ready to call. This allow to examine parameters before apply the call (and use them as a source for, say caching key generation) The call is "suspended" until really need to call.

var MyCall = FuncCall.Create((a, b, c) => { return a + b + c+ 1; }, 1, 2, 3)

That is, you may use MyCall.Func<ResultType> to check function properties and MyCall.Args as arguments given before the call. If source function does not take any arguments, content of Args is implemenation-defined, else it will be a tuple filled with arguments. You may use MyCall.Invoke() to do actual invocation. This would open way to efficient and simple ccing of function calls. Alternatively, you may use FuncCall.Call() to obtain FuncCallResult<ResultType> object that acts alike Task object with Result and Exception properties.

csharppluslittlethings's People

Contributors

sergeageyev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.