Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/06/2012 in all areas

  1. once the cat is out of the bag it will then be...
    3 points
  2. #include <Array.au3> $a = _GetFunctionsAndDescriptionVarFromAutoItScriptSourceAndPutThemInA2DArrayPerformMatchingNowPleaseThankYouOhAndJustSoYouKnowThisFunctionReturnsFalseIfItFinds0MatchesAndExpectsTheFirstParameterToBeAutoItScript(FileRead(@ScriptFullPath)) _ArrayDisplay($a) Func _GetFunctionsAndDescriptionVarFromAutoItScriptSourceAndPutThemInA2DArrayPerformMatchingNowPleaseThankYouOhAndJustSoYouKnowThisFunctionReturnsFalseIfItFinds0MatchesAndExpectsTheFirstParameterToBeAutoItScript($au3source) Local Const $description = "It's all in the name" Local $aArray = StringRegExp($au3source, "(?im)funch+(w+)h*(.*$s*(?:(?:dim|global|local)?(?:h+const)?)h*$descriptionh*=h*""([^""]+)""", 4) If @error Then Return SetError(1, 0, False) Local $aSubArray, $iUBound = UBound($aArray), $aReturn[$iUBound][2] = [[$iUBound]] For $i = 0 To $iUBound - 1 $aSubArray = $aArray[$i] $aReturn[$i][0] = $aSubArray[1] $aReturn[$i][1] = $aSubArray[2] Next Return $aReturn EndFunc ;==>_GetFunctionsAndDescriptionVarFromAutoItScriptSourceAndPutThemInA2DArrayPerformMatchingNowPleaseThankYouOhAndJustSoYouKnowThisFunctionReturnsFalseIfItFinds0MatchesAndExpectsTheFirstParameterToBeAutoItScript
    1 point
  3. Valik

    i = i++;

    According to Wikipedia (for what that's worth), you are correct - barely. I was under the impression that operators had function semantics even when not overloaded. Functions are sequence points. However, an operator only behaves like a function (and acts a sequence point) if it's overloaded. In this case, since the operators are not overloaded, it is undefined behavior.
    1 point
  4. danielkza

    i = i++;

    @Valik: As you wish: I understood that the specific case of assigning to and incrementing a variable in the same statement was the topic in discussion. That's what I was talking about. In respect to it, pre or post-increment is irrelevant: in both cases the behavior would be undefined because i would be modified twice before a sequence point. In theory it would be possible to write down some rules that would make sense of the code in the OP, but the spec omits them purposely in favor of freedom of implementation. The compiler is free to delay committing of variables to their storage (usually RAM) until a sequence point occurs, and that's why you can't be sure the increment will actually happen before or after the assignment.
    1 point
  5. Mat

    i = i++;

    In the ideal world you get a compiler message: ERROR: User stupidity level exceeded.
    1 point
×
×
  • Create New...