Questions tagged [quote]

The Lisp quote is a special operator that returns its only argument, unevaluated.

The Lisp quote is a special operator that returns its only argument, unevaluated.

638 questions
17
votes
2 answers

The #' in common lisp

In chapter 3 of Practical Common Lisp book there's an example of a SQL-like select and where functions. Here's a simplified version of it: (defun where (x) #'(lambda (item) (> item x))) and it is used like this: (remove-if-not (where 2)…
Max
  • 19,654
  • 13
  • 84
  • 122
16
votes
1 answer

XSLT: escaping double quote

I have XSLT code like: Consumer the value 3" Magnifier (has quote), I couldn't compare it with product…
Raj
  • 263
  • 1
  • 2
  • 14
16
votes
3 answers

Why isn't there an `unquote` Lisp primitive?

Lately, I've been thinking a lot about the basis of Lisp; I've read several manuals and/or other materials on the Internet, including The Roots of Lisp by P. ‎Graham: In The Roots of Lisp, quote is described as a primitive that changes code into…
SaltyEgg
  • 1,498
  • 1
  • 15
  • 26
15
votes
3 answers

What's the difference between ' and #' in Lisp?

It seems both (mapcar 'car '((foo bar) (foo1 bar1))) and (mapcar #'car '((foo bar) (foo1 bar1))) work as the same. And I also know ' means (quote symbol) and #' means (function function-name). But what's the underlying difference? Why these 2…
Thomson
  • 20,586
  • 28
  • 90
  • 134
14
votes
2 answers

Why use #' with lambda?

Why should I use #' together with lambda? It is usually written that way, so I guess it is good form. But these lines seem equal to me: > (mapcar #'(lambda (x) (+ x 1)) '(1 2 3)) (2 3 4) > (mapcar (lambda (x) (+ x 1)) '(1 2 3)) (2 3 4) Anyone care…
Johan Kotlinski
  • 25,185
  • 9
  • 78
  • 101
14
votes
4 answers

Golang : Escaping single quotes

Is there a way to escape single quotes in go? The following: str := "I'm Bob, and I'm 25." str = strings.Replace(str, "'", "\'", -1) Gives the error: unknown escape sequence: ' I would like str to be "I\'m Bob, and I\'m 25."
A.D
  • 2,150
  • 3
  • 13
  • 19
14
votes
4 answers

Bash eval replacement $() not always equivalent?

Everybody says eval is evil, and you should use $() as a replacement. But I've run into a situation where the unquoting isn't handled the same inside $(). Background is that I've been burned too often by file paths with spaces in them, and so like…
Shenme
  • 1,182
  • 1
  • 13
  • 12
13
votes
1 answer

Magento: change shipping method on existing order

I'm trying to change the shipping on an existing order in Magento. This works fine from the admin backend, even if it's quite the process since I have to manually update a lot of the order fields/attributes after I set the new shipping method on the…
Christoffer Bubach
  • 1,676
  • 3
  • 17
  • 45
12
votes
3 answers

how to create a quoted expression from strings

Given a vector of strings, I would like to create an expression without the quotation marks. # eg, I would like to go from c("string1", "string2") # to... (notice the lack of '"' marks) quote(list(string1, string2)) I am encountering some…
Ricardo Saporta
  • 54,400
  • 17
  • 144
  • 178
11
votes
2 answers

How to pass column name as parameter to function in dplyr?

I want to do the same as here but with dplyr and one more column. I want to selecting a column via a string variable, but on top I also want to select a second column normally. I need this because I have a function which selects a couple of columns…
lony
  • 6,733
  • 11
  • 60
  • 92
11
votes
3 answers

Why is $address->hasCouponCode() always returning null?

For some reason, the magento website does not apply the coupon codes. It always returns an invalid: Coupon code is not valid message. However, strangely enough, this happens when the price of cart is larger then 120 my currency. If I have one…
Fellner Arthur
  • 217
  • 3
  • 17
10
votes
3 answers

Quote Parameter for Facebook Share method no longer working?

Per Facebook dev documentation, the share parameter "quote" should insert text: https://developers.facebook.com/docs/sharing/reference/share-dialog/ This seemed to be working the other week, but now even using their own testing tool (…
J N S
  • 101
  • 3
9
votes
1 answer

Struts2 property tag. Force to escape single quote

I have rather silly problem. Struts2 property tag doesn't escape single quote ('). Such behavior breaks my JavaScript code. It does do escape double quote (") using html entities, but not single quote ('). Is there any possibility to force property…
Capacytron
  • 3,425
  • 6
  • 47
  • 80
9
votes
3 answers

bash aliases and awk escaping of quotes

I'm trying to create an alias for a command to see the memory use, ps -u user -o rss,command | grep -v peruser | awk '{sum+=$1} END {print sum/1024}' but, the naive, #.bash_aliases alias totalmem='ps -u user -o rss,command | grep -v peruser | awk…
Massagran
  • 1,781
  • 1
  • 20
  • 29
8
votes
3 answers

CSV files with quote and comma chars inside fields

I have a stack of CSV files I want to parse - the problem is half of the have quote marks used as quote marks, and commas inside main field. They are not really CSV, but they do have a fixed number of fields that are identifiable. The…
Jay Gattuso
  • 3,890
  • 12
  • 37
  • 51
1
2
3
42 43