Coder Social home page Coder Social logo

ECMA/JavaScript Callbacks about collatex HOT 1 OPEN

kkynde avatar kkynde commented on July 3, 2024
ECMA/JavaScript Callbacks

from collatex.

Comments (1)

kkynde avatar kkynde commented on July 3, 2024

This is an attempt to answer my own question. I should be grateful if some authorized person would confirm, correct or - even better - complete my research - read educated guesswork:

The command line takes the option --script func.js, containing a JavaScript function

function compare( base, witness ) {
if( base==witness ) return 0
else if( x<y ) return -1
else return 1
}

where the arguments are both string type values and the value returned is as for the Java String.compareTo().

Changes in upper- and lowercasing are by default ignored during alignment ( @rhdekker in #85 ), but if the objective is to alter this into an exact match, the above function will make no difference. This is because the arguments for compare() has already been normalized, i.e. to lower case and stripped of leading spaces. But don't panic, we can invent yet a function

function normalize( x ) {
return x ;
}

and behold, no normalization takes place. In fact, the first function compare() is now superfluous.

from collatex.

Related Issues (20)

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.