what is oci_bind_by_name for?

Изменить

Принимая во внимание ответ, ответ ниже относительно ссылка Спецификация языка ECMAScript - 11.13.2 Составное присвоение

Учитывая, почему они,

javascript:
   o="";  o = o + (o+=1)    ; alert(o);
   o="";  o =     (o+=1) + o; alert(o);

НЕ совпадают. Существуют временные семантические проблемы с оценкой сценария слева направо (ссылка: Спецификация ECMA - оператор сложения ). Одним из следствий этого является то, что оператор + не обязательно коммутативен.

Это также можно увидеть с помощью:

javascript:
   o=1;  o = o + (o+=1)    ; alert(o);
   o=1;  o =     (o+=1) + o; alert(o);

или

javascript:
   o=" _ ";  o = o + (o+=1)    ; alert(o);
   o=" _ ";  o =     (o+=1) + o; alert(o);

Парадигма ленивого оценивания, ошибочно и ненадлежащим образом используемая мной, создавая проблему ниже, также является плохим атрибутом моего личного образа действий.


Оригинал Сообщение

Следующие соображения, возможно, уже были учтены, хотя, похоже, нет. Если да, можно ли предоставить ссылки на обсуждения?

Формальная денотационная семантика движка времени исполнения Gecko Javascript - загадка. Empirical testing is exhausting and cannot be exhaustive.

  • Is there available an authoritative formal specification or official reference defining exactly how Gecko interprets Javascript?

The reference, ECMAScript Language Specification, seems inadequate, though credence is provided for the concoction of such scripts like,

javascript: alert( function(){return {}}().life=42 )

with the consequent meaning of such constructs when binding values.

  • Is there a definitive paradigm describing the Javascript code interpretation for object and instance evaluation?

This would clarify the concepts of call by (or rather use by) need, value, reference, inference, name, ... as relevant or not. That, Javascript is a prototyping interpreter, gives implicit meaning to some of the issues below.

What is the expected result of:

javascript: o={n:0}; f=function(){o.n+=1; return 10};
   alert([
      o.n,            f(),
      o.n,       o.n+=f(),
      o.n, eval('o.n+=f()'), 
      o.n, eval('o.n+='+f()),
      o.n,
   ].join(",\t"));

? Is it easy to predict the results (correctly!)?

The question is a bit rhetorical since it was specifically contrived with eval's to coerce and emphasize the subtle nuances of the interpretation. Can the evaluation of this script (and the aside below) be resolved with either, the ECMAScript Language Specification or another document, alluded to earlier?

(As an aside, consider:

javascript: ra=[];
   alert([
      ra, ra[ra.length]=" partially defined.",
      ra, ra.push("\n RA is not shown"),
      ra, ra.reverse()[42],
   ].join(",\t\t"));

which displays:

 RA is not shown, partially defined.,        partially defined.,        
 RA is not shown, partially defined.,       2,      
 RA is not shown, partially defined.,       

where the partial evaluations of ra are NOT analogous to o.n's!

and the following which is less exotic than using o.n:

javascript: o=""; f=function(){o+=1; return 0};
   alert([
      o,          f(),
      o,       o+=f(),
      o, eval('o+=f()'), 
      o, eval('o+='+f()),
      o,
   ].join(",\t"));

which displays:

,   0,  1,  10, 10, 100,    100,    10010,  10010

)

Considering the following script:

javascript:
   asn="\t\t and so now,\t o.n is "; nl="\n\n";
   o={}; f=function(){o.n+=1; return 10};
   alert(["Using:\n",window.navigator.userAgent,
   nl,"The function f() is:\n ",f,
   nl,"What the!!?!? \t\t\t\t\t\t\t initially \t\t o.n is ",          o.n = 0,
 nl,"Called as a procedure: \t\tf() is ", f(),                   asn, o.n,
nl,"but, instead of 12 \t\to.n+=f() is ", o.n+=f(),              asn, o.n,
     nl,"however eval'd\t\to.n+=f() is ", eval("o.n+="+f()),     asn, o.n,
    "!\n\nIt makes no functional difference if, instead of o.n, o['n'] is used.",
    "\nThe expected o.n evaluation sequence is 0, 1, (+1+10=) 12, (+1+10=) 23.",
    "\n_____ _____ _____ _____ _____ _____ _____ _____^^ missing in result",
  ].join(""));

The Gecko engine outputs:

Using:
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.3)
        Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/3.6.3

The function f() is:
 function () {
    o.n += 1;
    return 10;
}

What the!!?!?                                initially       o.n is 0

Called as a procedure:      f() is 10        and so now,     o.n is 1

but, instead of 12      o.n+=f() is 11       and so now,     o.n is 11

however eval'd          o.n+=f() is 22       and so now,     o.n is 22!

It makes no functional difference if, instead of o.n, o['n'] is used.
The expected o.n evaluation sequence is 0, 1, (+1+10=) 12, (+1+10=) 23.
_____ _____ _____ _____ _____ _____ _____ _____^^ missing in result
8
задан Community 23 May 2017 в 12:16
поделиться