tacit-programming

Anyone coding with APL?

we had a discussion about this language at work... Who works with that today? Don't we normally favor readability over smallest number of lines? ...

What do you call this functional language feature?

ok, embarrassing enough, I posted code that I need explained. Specifically, it first chains absolute value and subtraction together, then tacks on a sort, all the while not having to mention parameters and arguments at all, because of the presense of "adverbs" that can join these functions "verbs" What (non-APL-type) languages support t...

What is point free style in Functional Programming?

A phrase that I've noticed recently is the concept of "point free" style... First, there was this question, and also this one. Then, I discovered here they mention "Another topic that may be worth discussing is the authors' dislike of point free style." What is "point free" style? Can someone give a concise explanation? Does it have s...

J @ not working as expected

I'm just starting to try to pick up the J language, and am confused by the following: 1 2 +/@{ i.4 1 2 +/ 1 2 { i.4 3 when in the documentation for @ it says: "x u@v y ↔ u x v y" I assume I'm just mistaking one part of speech for another, but can't figure it out also, how do I tell what type of speech a name is? ...

Where can one find a list of all the operators in J

I am trying to learn J and one huge problem I'm running into is I don't know what all the predefined operators are or where to find them. It took me way too long to figure out the | is both the remainder function(when it dyadic) but when its used monadic it gets absolute value or magnitude. Does any one know where a list of all the ope...

Why is this J function not running?

I am attempting to learn J and the book I am using says this is the proper way to define a monadic function function =: 3:0 function statements so I followed this format and wrote the folding code. Can you tell me why this is throwing a syntax error when I try to call it with input but if I just call p it returns 3 h=:>:@i.@<....

In APL, how can I compute the lowest unused positive integer from a given set of integers?

For example, given 1 8 4 9 0 2 , return 3. Thanks. ...

Learning J/K/APL.

I know all 3 are related, and I've seen quite a few answers for problems in Project Euler written in J, and a few written K. What I'm wondering is, which would you suggest learning, and where would you suggest going about getting the materials to learn it? ...

How to refactor this in J?

My newbie solution to Project Euler #1 +/((0=3|1+i.1000-1) +. (0=5|1+i.1000-1)) * (1+i.1000-1) I know that this can be refactored, and transformed into a function, i don't know how to do it, and I would have to read all the labs to learn it. ...

How to refactor this in J?

Here is a different approach for the Project Euler #1 solution: +/~.(3*i.>.1000%3),5*i.>.1000%5 How to refactor it? ...

Is it possible to write tacit functions in F#

Tacit or point-free style programming allows one to create functions without regard to their arguments. Can this be done in F#? ...

How to rewrite the halve function in J?

Hi, in the J programming language, -: i. 5 the above function computes the halves of all integers in [0,4]. Now let's say I'd like to re-write the -: function, just for the fun of it. My best guess so far was ]&%.2 but that doesn't seem to cut it. How do you do it? ...

Best strategies for reading J code

I've been using J for a few months now, and I find that reading unfamiliar code (e.g. that I didn't write myself) is one of the most challenging aspects of the language, particularly when it's in tacit. After a while, I came up with this strategy: 1) Copy the code segment into a word document 2) Take each operator from (1) and place it...

Role of Combinators in Concatenative/Tacit Programming Languages.

Hi! I have a question about what exact role do higher-order combinators (or function producers) hold in concatenative/tacit programming. Additionally I would like to ask if there is another way to implement concatenative programming language rather than directly manipulating the stack. This might look like a newbie question, so if yo...

J: Self-reference in bubble sort tacit implementation

Hello people! Since I'm beginner in J I've decided to solve a simple task using this language, in particular implementing the bubblesort algorithm. I know it's not idiomatically to solve such kind of problem in functional languages, because it's naturally solved using array element transposition in imperative languages like C, rather th...

F# Tacit Programming

It's not a practically important issue, but could you please provide me with an example of tacit programming in F# where my `pointless' functions can have multiple arguments (not in form of list or tuple); And secondly, where those functions can manipulate a complex data structure. I'm trying to manage it in FSharp interactive, but have...

How to filter a list in J?

I'm currently learning the fascinating J programming language, but one thing I have not been able to figure out is how to filter a list. Suppose I have the arbitrary list 3 2 2 7 7 2 9 and I want to remove the 2s but leave everything else unchanged, i.e., my result would be 3 7 7 9. How on earth do I do this? ...

How do I define a monadic function to work on a list in J?

Let's say I have the following J expression: # 3 ((|=0:)#]) 1+i.1000 This counts the number of numbers between 1 and 1000 that are evenly divisible by 3. (Now, before anyone points out that there's an easier way to do this, this question is about the syntax of J, and not mathematics.) Let's say I define a monadic function for this, as...

Setting the rank of a user-defined verb in J

Here's a function to calculate the digital sum of a number in J: digitalSum =: +/@:("."0)@": If I use b. to query the rank of this verb, I get _ 1 _, i.e., infinite. (We can ignore the dyadic case since digitalSum is not dyadic.) I would like the monadic rank of this verb to be 0, as reported by b.. The only way I know of to do this i...

Abstracting boxed array structures in J

I've been working on a J function for a while, that's supposed to scan a list and put consecutive copies of an element into separate, concatenated boxes. My efforts have taken me as far as the function (<;. 2) ((2&(~:/\)),1:) which tests successive list entries for inequality, returns a list of boolean values, and cuts the list into ...