Questions tagged [cdr]

cdr (/ˈkʌdər/ or /ˈkʊdər/) is primitive operation on cons cells (or "non-atomic S-expressions") introduced in the Lisp programming language.

cdr (/ˈkʌdər/ or /ˈkʊdər/) is primitive operation on cons cells (or "non-atomic S-expressions") introduced in the Lisp programming language. A cons cell is composed of two pointers; The cdr operation extracts the second pointer.

Thus, the expression (cdr (cons x y)) evaluates to y.

For Compact Disc Recordable, use instead.

Source: Wikipedia

103 questions
92
votes
3 answers

What does "my other car is a cdr" mean?

Can anyone well versed in lisp explain this joke to me? I've done some reading on functional programming languages and know that CAR/CDR mean Contents of Address/Decrement Register but I still don't really understand the humour.
CaptainCasey
  • 1,361
  • 1
  • 14
  • 21
19
votes
2 answers

How do I access the not-the-first elements of an array in Swift?

Swift's Array has a first function which returns the first element of the array (or nil if the array is empty.) Is there a built-in function that will return the remainder of the array without the first element?
Robert Atkins
  • 23,528
  • 15
  • 68
  • 97
12
votes
4 answers

Difference between CDR, CAR and REST, FIRST and possible implementation?

I'm learning a little bit about functional programming in LISP and here's what I've bumped into: LISP uses CAR, CDR functions as well as FIRST and REST functions. Both related to lists. From what I've learned so far, there's a difference between…
FanaticD
  • 1,416
  • 4
  • 20
  • 36
11
votes
3 answers

SVG to CDR converter

I have an SVG file which contains rotated, semi-transparent, clipped (clip-path) elements (e.g polygons, images). This file is perfectly working in Inkscape but for further image processing I would like to use it in CorelDraw, too. But opening in…
Zsonyo
  • 119
  • 1
  • 4
6
votes
3 answers

Whats the best architecture for CDR integration to a Asterisk based Application

Iam developing a VOIP platform which would allow users to make 100s of calls concurrently using my service. Asterisk stores all call detail records in the CDR table. I would like to know where is best place to keep this table for the best possible…
Sumit Ghosh
  • 3,264
  • 4
  • 40
  • 59
5
votes
3 answers

cons :: operator for sequences in F#?

Is there a better code that does not need to transform the sequence into a list ? let rec addentry map keys = match keys with | ((i,j) :: tail) -> Map.add (i,j) ((inputd.[i]).[j]) (addentry map tail) | ([]) -> map addentry Map.empty…
nicolas
  • 9,549
  • 3
  • 39
  • 83
5
votes
2 answers

perl6 functions similar to "car cdr cons" in scheme?

I really love perl6 and scheme. I am wondering if there are functions in perl6 that are similar to the "cons, car, cdr" functions in scheme? What I have been doing feels cumbersome: sub cons($a, $aList) { return flat($a, $aList); } # sometimes flat…
lisprogtor
  • 5,677
  • 11
  • 17
4
votes
3 answers

mysql query - peak concurrent calls CDR data

Hi I need help working out how to calculate how many peak concurrent calls I have in a day from my CDR date stored in MySQL. The data set looks like this: INSERT INTO `cdr` (`calldate`, `clid`, `src`, `dst`, `dcontext`, `channel`, `dstchannel`, …
user3246938
  • 89
  • 2
  • 12
4
votes
1 answer

saving data into custom cdr field

I created custom field "rec_name" id table "cdr", database "asteriskcdrdb". In this field I want to store recording name. I know I should do it by adding this line in one of .conf files, but where? exten => s,1,set(CDR(rec_name)=${CALLFILENAME}) I…
voy
  • 1,568
  • 2
  • 17
  • 28
3
votes
1 answer

Scheme: Getting cdr without the parens

This is probably a simple thing I'm missing, but I'm trying to get the cdr of a pair and every call to say (cdr (cons 'a '5)) comes back as (5). I sort of get why that is, but how can I get the it to return without the parens? I don't want to use…
jbrennan
  • 11,943
  • 14
  • 73
  • 115
3
votes
3 answers

Python: functional programming with cons, car & cdr

There is this problem that goes like this: cons(a, b) constructs a pair, and car(pair) and cdr(pair) returns the first and last element of that pair. For example, car(cons(3, 4)) returns 3, and cdr(cons(3, 4)) returns 4. Now, I have seen the…
Helen
  • 533
  • 12
  • 37
3
votes
4 answers

Looking for an explanation of Asterisk's cdr log fields

Asterisk has the following fields CREATE TABLE `cdr` ( `calldate` datetime NOT NULL default '0000-00-00 00:00:00', `clid` varchar(80) NOT NULL default '', `src` varchar(80) NOT NULL default '', `dst` varchar(80) NOT NULL default '', …
johnml
  • 453
  • 1
  • 6
  • 16
3
votes
3 answers

why the change is in place for the list with elisp?

I have a question about elisp. For example: (setq trees '(maple oak pine birch)) -> (maple oak pine birch) (setcdr (nthcdr 2 trees) nil) -> nil trees -> (maple oak pine) I thought (nthcdr 2 trees) returns a new list - (pine birch)…
RNA
  • 146,987
  • 15
  • 52
  • 70
3
votes
1 answer

chan->cdr no data after upgrade from Asterisk 1.4.21

I have a legacy Asterisk application in C which does authentication of users, routing and billing using MySQL. I have kept it with Asterisk 1.4.21 because none of the CDR data is returned in newer versions of Asterisk. Apparently there have been…
Ed.C
  • 798
  • 1
  • 6
  • 17
3
votes
1 answer

Variadic Function in Scheme

I have to define a variadic function in Scheme that takes the following form: (define (n-loop procedure [a list of pairs (x,y)]) where the list of pairs can be any length. Each pair specifies a lower and upper bound. That is, the following function…
aquemini
  • 950
  • 2
  • 13
  • 32
1
2 3 4 5 6 7