Code Monkey home page Code Monkey logo

Comments (3)

nmorse avatar nmorse commented on June 24, 2024

Even if named vars can be considered (a bite out of pure point-free).

# discriminant (with locally named args)
2 3 4 quo [c] def quo [b] def quo [a] def
b dup * 4 a * c * -
# >>> -23
## but the problem is that we really don't want args defined globally, so...
[a b c] [b dup * 4 a * c * -] [discriminant] define
2 3 4 discriminant
# >>> -23

The alternate pure point-free is a tangle of stack shufflers.

from pounce_v0.

nmorse avatar nmorse commented on June 24, 2024
[a b c op] [b -1 * b b * 4 a * c * squareroot  op 2 a * /] [quadratic-crossing]
[a b c] [a b c discriminant dup 0 < [[]] if dup 0 > [[ a b c [+] quadratic-crossing] ...] [] if-else] [quadratic]

manageable with the local-defined values (words) , but the stack swapping version is too complex to show here.

from pounce_v0.

nmorse avatar nmorse commented on June 24, 2024

since define has matured into a useful construct with local-words, adding named-args
(e.g. named-args:[x y]) to consume stack arguments into getters to be used in the definition and local-words seem like an interesting enough idea to pursue.

{named-args: [a b c]
 local-words: { discriminant: [ ... ] quadratic-crossing: [ ... ] ... }
 definition: [a b c discriminant dup 0 < [[]] if dup 0 > [[ a b c [+] quadratic-crossing] ...]
} [quad] define

from pounce_v0.

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.