Comments (10)
Those would be 3β₯0
and 2β"abcdef"
. See Indices for more discussion on Select (β
) versus Pick (β
) though.
from bqn.
The non-array part of formatting was just casting to a string with ""+x
(it has to be implemented in Javascript, since there isn't a way to find a scalar's type from BQN yet). I've improved it to detect primitives and infinities, and use Β―
for a minus sign. For non-primitive functions and modifiers, it just prints the type, for example *1-modifier*
. Since they're anonymous functions, deconstructing them to get better output would be difficult with the current VM. But at least there are no raw function printouts any more.
from bqn.
It's printing the source code of the function. The JS BQN compiler converts your code to JS code to be evaluated, and it seems there's nothing preventing that source code from just being printed. As a simpler example, try just !
.
from bqn.
Ok, fascinating, is this a user error on my end?
from bqn.
There's no reason to not allow printing functions, whatever that ends up as being. It could of course be made to print something nicer, but that's probably of relatively low priority compared to other things about the language.
from bqn.
Oh! I see, I am trying to call the functions, is there something obvious I'm missing to initiate that call?
from bqn.
{π©β0} 3
is equivalent to 3β0
, which is syntactically like 3β£0
in APL - you aren't calling anything, you end up with a 2-modifier (dyadic operator in APL terms), derived to a function. Similarly for 2βΆ"abcdef"
- it's again just deriving a 2-modifier
from bqn.
That makes sense, I'm coming from J and am still getting the hang of things.
How do I repeat 3 "0"s and select the 2th item respectively?
from bqn.
As a quick test, anything circled is a 2-modifier (aka conjunction; β½β
are exceptions and are functions similar to APL), and superscripts (ΛΒ¨ΛβΌβΒ΄`
) are 1-modifiers (adverbs); see this
from bqn.
Ok perfect! I got my simple example working
{π©βΏπ© β₯ 1βΎ π©β₯0} 3
Thank you both for the help.
from bqn.
Related Issues (20)
- Explain the use of `under ββΎ` primitive in tutorial/variable.md HOT 1
- Keyboard special character map HOT 6
- VM docs for `+` don't mention monadic case
- Roadmap HOT 1
- Installation confusion HOT 3
- Allow Emojii variable names HOT 6
- Confusing Take error in REPL HOT 1
- :bug: Grade Up/Down Broken HOT 4
- Hovering on Scan in the online REPL does not show input help HOT 4
- Small typo in Array Language Complilation
- Macron not explained in expressions tutorial HOT 2
- The example of `Switch` produces an error HOT 1
- Request for flashy examples in docs HOT 2
- Idea: BRFI? HOT 3
- 3 | Β―4 results in 2 in BQNPAD and the online REPL HOT 2
- Tutorial: 1-Modifier example HOT 1
- Graph unfriendly to color-blindness HOT 1
- Typo in bqnpad ceiling operator HOT 1
- Unfinished documentation HOT 1
- Mention VS Code extension in Editor Support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bqn.