In computer science, the syntax of a programming language is the set of rules that define the combinations of symbols that are considered to be correctly structured programs in that language.

learn more… | top users | synonyms

4
votes
1answer
138 views
0
votes
1answer
66 views

What are the drawbacks of DRY input validation configuration?

I have designed the following input validation implementation with one goal: DRY. I'd like to know whether it is intuitive and what are the possible shortcomings. ...
10
votes
2answers
465 views

C-style language lexer for a syntax highlighter

I'm working on implementing a syntax highlighter for a simple text editor I've been working on. To do this, I need a simple lexer for various languages (I don't need a full one - I'm only interested ...
1
vote
2answers
121 views

Python array literal syntax sugar similar to Perl and Ruby

Background Python (version 2.7.2) Problem You want to specify an array in your code. You want to use the 'syntax sugar' available in Ruby and Perl. You are a fanatic about readable code but also ...
0
votes
1answer
72 views

Manage Case Statement with (Int, long, short, double…)

I have the following case statements that has to be modified to fit these cases: Dec, Double, ...
1
vote
1answer
115 views

Color fading function

I found this old color fading function in my snippets folder and would like to implement it to one of my projects. It can be used to fade one color to another. It's a very long one-liner: ...
7
votes
1answer
627 views

A C++ PEG parser generator

I wrote a C++ PEG packrat parser generator and would love to get some feedback on the code and/or syntax. I currently use the << operator for defining grammar ...
6
votes
1answer
206 views

Improve my little syntactic hack

Current best practice for using a lock_guard looks like this: ...
1
vote
2answers
239 views

My language, gecho [closed]

I wrote a language in C, dubbed gecho. The code can be found at http://github.com/tekknolagi/gecho/tree/testing I'm writing this for a purely educational reason ...
6
votes
6answers
326 views

Explicit Function Notation in Perl

I've gone back and forth a few times recently on my Perl coding style when it comes to module subroutines. If you have an object and you want to call the method bar ...