compose(a, b) = x => a(b(x))
It's indeed more pointless than Haskell:-)Btw, the `x' in that definition is the `point' from which the name originates.
31–37 of 37 posts
compose(a, b) = x => a(b(x))
It's indeed more pointless than Haskell:-)Btw, the `x' in that definition is the `point' from which the name originates.
Reminds me of LiveScript. Nowadays, you might be able to achieve something similar with JS + a bunch of Babel plugins, like pipeline operator and so.
This is pretty cool. After reading half the examples, I started wondering "wait what are you doing with the output variable", and then it clicked and I checked the docs, and yep, outputting to stdout is done by assignment to a magic `output` variable. A very interesting/novel approach to things.
Classic BASIC implementation picked up on this idea. For instance some dialects had an INKEY$ variable which looks like a string, but magically reads console input. GNU Bash has a magic variable RANDOM that produces random numbers. Assignments to it appear to be ignored. In Algol, the name of the enclosing function acts as a variable to which you assign in order to produce the return value. For instance, see the assi…
Assignments are used to seed¹ the random number generator². This isn't limited to just bash/zsh/etc, it is intrinsic to the process of generating random numbers. Being aware of this is useful as it poses a significant footgun. The /dev/random docs³ provide a nice overview of how it is often handled on various systems at the OS level to deal with reboots.
An example of the fun that this can produce can be seen in a Debian bug⁴, running a script that uses subshells and RANDOM with bash will behave very differently when using zsh. In this instance you have to hope that subshells aren't being used to create unique logs as an example.
1. https://en.m.wikipedia.org/wiki/Random_seed
2. https://en.m.wikipedia.org/wiki/Random_number_generator
How would you describe the difference between an Object and a Map in Pointless? Having read the documentation, I don't see any difference other than whether non-string keys are allowed, and as a result the syntax for value access (`obj.key` vs `map["key"]`). And one of the things I've been wondering about with regard to language design is why more languages don't take a Clojure-like approach of fully merging the conc…
Hello, I'm the author of this project: Pointless originally had a static type-system, which I later ditched (the type-system was pretty experimental, and I never got it working to my liking). So the object / map division is a holdover from that. I'll probably keep them separate for now to leave the option of static typing open, but I agree that it's a bit redundant for now. The only remaining technical differences ar…
How would you describe the difference between an Object and a Map in Pointless? Having read the documentation, I don't see any difference other than whether non-string keys are allowed, and as a result the syntax for value access (`obj.key` vs `map["key"]`). And one of the things I've been wondering about with regard to language design is why more languages don't take a Clojure-like approach of fully merging the conc…
Hello, I'm the author of this project: Pointless originally had a static type-system, which I later ditched (the type-system was pretty experimental, and I never got it working to my liking). So the object / map division is a holdover from that. I'll probably keep them separate for now to leave the option of static typing open, but I agree that it's a bit redundant for now. The only remaining technical differences ar…
to follow up on this, does this mean that Pointless actually allows inheritance and polymorphic dispatch? Because clearly functions are first class, so they could easily be values in a map just like they could live in an object.
This is pretty cool. After reading half the examples, I started wondering "wait what are you doing with the output variable", and then it clicked and I checked the docs, and yep, outputting to stdout is done by assignment to a magic `output` variable. A very interesting/novel approach to things.
Classic BASIC implementation picked up on this idea. For instance some dialects had an INKEY$ variable which looks like a string, but magically reads console input. GNU Bash has a magic variable RANDOM that produces random numbers. Assignments to it appear to be ignored. In Algol, the name of the enclosing function acts as a variable to which you assign in order to produce the return value. For instance, see the assi…
BASIC's version of $RANDOM is RND(x), and I remember that the sign of the argument was the most important thing. Negative values seeded the PRNG and any positive argument got you the next random number. Some later dialects had a RANDOMIZE statement.
The funny thing is BASIC also had a couple functions that took input variables, but didn't do anything with them, like POS() and FRE(). I think FRE's argument may have been significant on a couple BASICs.