terminology

What's the difference between parse tree and AST?

爱⌒轻易说出口 提交于 2019-11-26 17:29:57
问题 Are they generated by different phases of a compiling process? Or are they just different names for the same thing? 回答1: This is based on the Expression Evaluator grammar by Terrence Parr. The grammar for this example: grammar Expr002; options { output=AST; ASTLabelType=CommonTree; // type of $stat.tree ref etc... } prog : ( stat )+ ; stat : expr NEWLINE -> expr | ID '=' expr NEWLINE -> ^('=' ID expr) | NEWLINE -> ; expr : multExpr (( '+'^ | '-'^ ) multExpr)* ; multExpr : atom ('*'^ atom)* ;

What is a monad?

假装没事ソ 提交于 2019-11-26 17:29:05
问题 Having briefly looked at Haskell recently, what would be a brief, succinct, practical explanation as to what a monad essentially is? I have found most explanations I've come across to be fairly inaccessible and lacking in practical detail. 回答1: First: The term monad is a bit vacuous if you are not a mathematician. An alternative term is computation builder which is a bit more descriptive of what they are actually useful for. You ask for practical examples: Example 1: List comprehension : [x*2

What's the difference between a web site and a web application? [closed]

元气小坏坏 提交于 2019-11-26 16:50:37
I'm stumped trying to come up to a difference between a website and a web application for myself. As I see it, a web site points to a specific page and a web application is more of some sort of 'portal' to content and information. But where I'm stuck is that a web application is still viewed through a browser (is it not?) and a website can still view content dynamically, making the line between web site and application pretty gray. For instance, does a web site using ASP.NET or AJAX etc become a web application because it can retrieve data dynamically and asynchronously or would a website

Meanings of declaring, instantiating, initializing and assigning an object

别来无恙 提交于 2019-11-26 16:08:35
问题 Technically what are the meanings and differences of the terms declaring , instantiating , initializing and assigning an object in C#? I think I know the meaning of assigning but I have no formal definition. In msdn, it is said "the act of creating an object is called instantiation". But the meaning creating seems vague to me. You can write int a; is a then created? 回答1: Declaring - Declaring a variable means to introduce a new variable to the program. You define its type and its name. int a;

Difference between parameter and argument [duplicate]

亡梦爱人 提交于 2019-11-26 15:42:12
This question already has an answer here: What's the difference between an argument and a parameter? 31 answers Is there a difference between a "parameter" and an "argument", or are they simply synonyms? danlei Argument is often used in the sense of actual argument vs. formal parameter. The formal parameter is what is given in the function declaration/definition/prototype, while the actual argument is what is passed when calling the function — an instance of a formal parameter, if you will. That being said, they are often used interchangeably, their exact use depending on different programming

What are REST resources?

无人久伴 提交于 2019-11-26 15:32:39
问题 What are REST resources and how do they relate to resource names and resource representations? I read a few articles on the subject, but they were too abstract and they left me more confused than I was before. Is the following URL a resource? If it is, what is the name of that resource and what is its representation? http://api.example.com/users.json?length=2&offset=5 The GET response of the URL should look something like: [ { id: 6, name: "John" }, { id: 7, name: "Jane" } ] 回答1: The reason

What exactly is the difference between “pass by reference” in C and in C++?

蓝咒 提交于 2019-11-26 15:13:47
问题 The phrase "pass by reference" is used by C and C++ developers alike but they appear to be used to mean different things. What exactly is the difference between this equivocal phrase in each language? 回答1: There are questions that already deal with the difference between passing by reference and passing by value. In essence, passing an argument by value to a function means that the function will have its own copy of the argument - its value is copied. Modifying that copy will not modify the

What's the difference between a Resource, URI, URL, Path and File in Java?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-26 15:07:03
问题 I'm looking at a piece of Java code right now, and it takes a path as a String and gets its URL using URL resource = ClassLoader.getSystemClassLoader().getResource(pathAsString); , then calls String path = resource.getPath() and finally executes new File(path); . Oh, and there are also calls to URL url = resource.toURI(); and String file = resource.getFile() . I'm totally confused right now - mostly because of the terminology, I guess. Can someone please walk me through the differences, or

The Difference Between Deprecated, Depreciated and Obsolete [closed]

吃可爱长大的小学妹 提交于 2019-11-26 15:05:02
问题 There is a lot of confusion about this and I'd like to know, what exactly is the difference between depreciated , deprecated and obsolete , in a programming context, but also in general. I know I could just look at an online dictionary, and I have, even at many, but they don't all agree, or there are differences in what they say. So I decided to just ask here, considering I also want an answer in a programming context. If I understand right, deprecated means it shouldn't be used anymore,

What is 'Pattern Matching' in functional languages?

泪湿孤枕 提交于 2019-11-26 14:58:50
问题 I'm reading about functional programming and I've noticed that Pattern Matching is mentioned in many articles as one of the core features of functional languages. Can someone explain for a Java/C++/JavaScript developer what does it mean? 回答1: Understanding pattern matching requires explaining three parts: Algebraic data types. What pattern matching is Why its awesome. Algebraic data types in a nutshell ML-like functional languages allow you define simple data types called "disjoint unions" or