language-construct Questions
6
Solved
I've been puzzling about this for a while and I've looked around a bit, unable to find any discussion about the subject.
Lets assume I wanted to implement a trivial example, like a new looping con...
Polito asked 31/7, 2012 at 21:24
7
Solved
I saw this today in some PHP code:
$items = $items ?: $this->_handle->result('next', $this->_result, $this);
I'm not familiar with the ?: operator being used here. It looks like a terna...
Sherrell asked 3/1, 2010 at 0:10
6
Solved
Suppose I have code like this:
void f(int a = 0, int b = 0, int c = 0)
{
//...Some Code...
}
As you can evidently see above with my code, the parameters a,b, and c have default parameter values...
Trela asked 6/8, 2016 at 18:10
11
Solved
I am learning C from 'Programming in C' by Stephen Kochan.
Though the author is careful from the beginning only not to confuse the students with jargon, but occasionally he has used few terms wit...
Nephron asked 7/4, 2012 at 19:15
5
Solved
I recently came up across a problem/solution that used Loop Do. I seldom have seen this so far in my learning Ruby Programming (I am a beginner with no CS experience).
# Write a function, `neares...
Tramway asked 29/5, 2013 at 11:55
7
I keep coming across statements like:
echo is a language construct but
print is a function and hence has a
return value
and
die is a language construct
My question is what are these language co...
Phantom asked 15/7, 2010 at 9:41
3
Solved
I need to use constant as class name for acces to this class static property, that is
class a {
public static $name = "Jon";
}
define("CLASSNAME", "a");
echo CLASSNAME::$name;
this returns ...
Tabulate asked 2/2, 2013 at 13:1
3
As I learn JavaScript I've been looking around the web and seen numerous references to constructs in Javascript, but I can't seem to find a complete definition of what they are and what they are no...
Thomas asked 3/9, 2012 at 5:30
4
Solved
In JavaScript ES6, there is a language feature known as destructuring. It exists across many other languages as well.
In JavaScript ES6, it looks like this:
var animal = {
species: 'dog',
weigh...
Cube asked 13/7, 2015 at 22:22
6
Solved
As new to Powershell world, sometime I'm stuck in the tricky syntax. That's why I'm trying to figure out all the possible uses of the parenthesis inside the language.
Do you know some more? Can yo...
Perhaps asked 5/4, 2011 at 21:3
2
In the code:
public interface ProductInterface {
public List<ProductVO> getProductPricing(ProductVO product, ProductVO prodPackage, String... pricingTypes) throws ServiceException;
...
Cancroid asked 11/8, 2013 at 20:49
3
Solved
I think most of us that program in php learned to echo "string";. While common, I am wondering why we use this so different then any other function.
So why do we do:
echo "Some Strin...
Germane asked 22/5, 2013 at 9:36
4
Solved
Can anybody tell the internal procedure of the below expression?
<?php echo '2' . print(2) + 3; ?>
// outputs 521
Brammer asked 1/11, 2012 at 11:25
4
Solved
I've just read the page on Expressions in the PHP docs, and right at the top it says:
The simplest yet most accurate way to define an expression is "anything that has a value".
That simple def...
Flattop asked 7/5, 2012 at 2:32
8
I recently stumbled upon a piece of code that went like this:
Object o = .. ;
Foo foo = Foo.class.cast(o);
I was actually not even aware that java.lang.Class had a cast method, so I looked...
Backrest asked 26/10, 2011 at 8:38
2
Solved
I think that shadow variables are too dangerous to use them. Why does Scala support this language construct? There should be some strong reason for that, but I cant find it.
Tribunate asked 11/8, 2011 at 18:40
3
Solved
Background:
I was "dragged" into seeing this question:
Fibonacci's Closed-form expression in Haskell
when the author initially tagged with many other languages but later focused to a Haskell q...
Elissaelita asked 21/5, 2011 at 15:16
3
Solved
I have seen this in a piece of JS code:
var {status, headers, body} = res;
What does it do?
Inescutcheon asked 4/3, 2011 at 6:26
3
Solved
This is really odd. Can anyone explain this?
This code does NOT work:
const byte ASC_OFFSET = 96;
string Upright = "firefly";
byte c7 = (byte)Upright[6] - ASC_OFFSET;
//Cannot implicitly convert ...
Analogy asked 2/1, 2011 at 7:28
3
I'm just curious. In PHP, why wasn't echo implemented as a function? Why didn't PHP just give us printf and never tell about echo? Please note that:
This is not a question about echo vs. printf.
...
Neoplasticism asked 30/8, 2010 at 9:6
2
Solved
I have a method:
def foo(bar):
# ...
Is there a way to mark bar as constant? Such as "The value in bar cannot change" or "The object pointed to by bar cannot change".
Lira asked 21/6, 2010 at 0:13
3
Solved
Possible Duplicate:
What are the PHP operators “?” and “:” called and what do they do?
From http://twitto.org/
<?PHP
require __DIR__.'/c.php';
if (!is_callable($c = @$_GET['c'] ?...
Copernicus asked 28/1, 2010 at 8:33
7
Solved
I'm new to PHP. I came across this syntax in WordPress. What does the last line of that code do?
$page = $_SERVER['REQUEST_URI'];
$page = str_replace("/","",$page);
$page = str_replace(".php","",$...
Clerical asked 20/1, 2010 at 8:9
4
Solved
I know that include, isset, require, print, echo, and some others are not functions but language constructs.
Some of these language constructs need parentheses, others don't.
require 'file.php';
...
Unbend asked 24/7, 2009 at 21:16
41
Solved
To me it was the If statement, I'm psyched up, since then I believed that computers are very intelligent, or I can at least make it appear intelligent because of it.
Pruett asked 10/1, 2009 at 15:30
1 Next >
© 2022 - 2024 — McMap. All rights reserved.