Questions tagged [tacit-programming]

Tacit programming is a programming paradigm in which a function definition does not include information regarding its arguments, using combinators and function composition (but not λ-abstraction) instead of variables. The simplicity behind this idea allows its use on several programming languages, such as APL and J.

Wiki

Tacit programming is one of the styles possible in the J and APL programming languages, and means coding by combining functions, without reference to argument names. This idea may have been first brought up in functional programming; it's simpler than lambda calculus.

Tacit programming is also known as point-free style, or pointless programming, because of the lack of explicit arguments, or points.

Example

In J, the same sort of point-free code occurs in a function made to compute the average of a list (array) of numbers:

 avg=: +/ % #

Details: # counts the number of items in the array. +/ sums the items of the array. % divides the sum by the number of items.

Tag usage

The tag can be used for programming related questions in implementation of J and APL programming languages, Question with the tags or can also use tag . Please avoid theoretical questions on Stack Overflow.

Read more

74 questions
3
votes
2 answers

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…
faceless1_14
  • 7,382
  • 9
  • 31
  • 33
2
votes
2 answers

Check that each adjacent pair of a list is in order (tacit programming) in APL

Given a list in APL I would like to check that each adjacent pair is in order. So, given (a0, a1, ..., an), I would like to calculate: (a0 ≤ a1) ∧ (a1 ≤ a2) ∧ .... ∧ (a[n-1] ≤ an) I don't want to compute an equivalent form and I want to use tacit…
koteth
  • 35
  • 4
2
votes
2 answers

How can I extract multiple elements from a matrix in an APL tacit function?

(Dyalog) APL learner question If I have a matrix Y: Y 4 9 2 3 5 7 8 1 6 I can get two of its members like this: Y[(1 1) (2 2)] 4 5 I can use the same technique using dfn syntax: {⍵[(1 1) (2 2)]}Y 4 5 I, however, can't work…
Anthony Berent
  • 105
  • 1
  • 6
2
votes
3 answers

racket syntax pattern with multiple ...s

I'm working on a syntax for racket using pipes similar to unix, something like this: > ("FOO" > string-replace "O" "E" > string-append "x" > string-downcase) "feex" Here is a brute force solution, which supports procedures with 2, 1, and 0 (extra)…
Roger Keays
  • 3,117
  • 1
  • 31
  • 23
2
votes
2 answers

Void Verbs in J

I'm learning how to use J via online reading and doing some old Java assignments over again using this language, and would like to know how to make a verb that doesn't take any operands, or return any result. The reason being: I would like to allow…
S_Lang
  • 87
  • 2
2
votes
1 answer

How do I do file io in J?

I want to be able to read and write files, etc. How can I do this?
Gregory Higley
  • 15,923
  • 9
  • 67
  • 96
2
votes
3 answers

How can I define a verb in J that applies a different verb alternately to each atom in a list?

Imagine I've defined the following name in J: m =: >: i. 2 4 5 This looks like the following: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 I want to create a monadic verb of…
Gregory Higley
  • 15,923
  • 9
  • 67
  • 96
2
votes
2 answers

Systematically extract noun arguments from J expression

What is the systematic approach to extracting nouns as arguments from an expression in J? To be clear, an expression containing two literals should become a dyadic expression with the left and right arguments used instead of the literals. I'm…
dukereg
  • 722
  • 5
  • 16
2
votes
1 answer

Tacit function to multiply five consecutive number in a list: J, j701

I'm working on Project Euler, I'm on problem 8, and I'm trying a simple brute force: Multiply each consecutive 5 digit of the number, make a list with the results, and find the higher. This is the code I'm currently trying to write in J: n =:…
user884352
2
votes
1 answer

J Programming Beginners Loop

Could someone kindly explain the control structure in J (specifically For and While loops)? Let's say I have a=:1 and b=:10, and I want to add '1' to 'a' using For/While loops till a < b. So, usually it would be something like (in other languages)…
babsdoc
  • 693
  • 2
  • 11
  • 24
1
vote
3 answers

modifying an element of a list in-place in J, can it be done?

I have been playing with an implementation of lookandsay (OEIS A005150) in J. I have made two versions, both very simple, using while. type control structures. One recurs, the other loops. Because I am compulsive, I started running comparative…
Nick
  • 199
  • 6
1
vote
1 answer

Equivalent tacit expressions

I'm rather new to the J programming language and I have a question about equivalent tacit expressions in J. I found two lines of J that were equivalent, but the conjunction in the code (^:)'s arguments were switched using the bracket operators. I…
1
vote
1 answer

How to represent binary logical in Three Address Code

In three address code a branch can only have a binary relational operator, e.g. if x relop y goto L1, where relop is (!=,==,>,>=,<,<=) How would the following be represented as three address code format: j = 0 while(j < 10 || j < 20) { …
webchatowner
  • 145
  • 1
  • 1
  • 10
1
vote
2 answers

Ramda: rewriting to point free style

I use the following function to send some data to a React component by wrapping it in a higher-order component: import { equals, filter, isNil, prop, where } from 'ramda' const example = getChapter => ownProps => filter( where({ …
1
vote
1 answer

Implement F# interface via tacit programming

An idea from tacit programming is to not apply arguments to functions if it can be avoided. Why doesn't F# allow this to compile if functions are first class members? type IAdder = interface abstract member Add : int -> int -> int end type…