Is this valid code?
function escape_html(s)
{
return s
.replaceAll("&", "&") /* always do first, rest can be in any order */
.replaceAll("\"", """)
.replaceAll("<", "<")
.replaceAll(">", ">")
.replaceAll("\t", "	")
.replaceAll("\n", " ")
} /*escape_html*/
Another example. This doesn’t work:
return
{
source : "/autocomplete/search-widget.php",
select :
function (event, ui)
{
$("#select_widget_name").val(ui.item.label)
$("#select_widget_id").val(ui.item.value)
} /*function*/,
}
Why do you call it "Statement-Continuation Rule"? Isn't it expression evaluation?
Is this valid code?
function escape_html(s)
{
return s
.replaceAll("&", "&") /* always do first, rest can be in any order */
.replaceAll("\"", """)
.replaceAll("<", "<")
.replaceAll(">", ">")
.replaceAll("\t", "	")
.replaceAll("\n", " ")
} /*escape_html*/
On Tue, 20 Feb 2024 11:04:57 +0000, John Harris wrote:
Why do you call it "Statement-Continuation Rule"? Isn't it expression
evaluation?
No, it’s about when a statement is considered to continue onto another line, and when it isn’t.
But I have my doubts.
So method chaining might not always satisfied the
same expectations about being a more "functional" approach.
On Thu, 22 Feb 2024 11:37:52 +0100, Mild Shock wrote:
But I have my doubts.
Show us your non-method-chained-style version, then.
Lawrence D'Oliveiro schrieb:
On Thu, 22 Feb 2024 11:37:52 +0100, Mild Shock wrote:Guido von Rossum suggest to not always use method chaining:
But I have my doubts.
Show us your non-method-chained-style version, then.
On Fri, 23 Feb 2024 00:49:08 +0100, Mild Shock wrote:<snip>
Lawrence D'Oliveiro schrieb:
On Thu, 22 Feb 2024 11:37:52 +0100, Mild Shock wrote:
Guido von Rossum suggest to not always use method chaining:
Which is not really answering my question, is it?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 376 |
Nodes: | 16 (2 / 14) |
Uptime: | 27:43:32 |
Calls: | 8,023 |
Calls today: | 2 |
Files: | 13,028 |
Messages: | 5,824,254 |