btwael / mammouth

Unfancy PHP
http://mammouth.boutglay.com
MIT License
214 stars 22 forks source link

PHP language constructs and string joining operator #18

Closed CezaryDanielNowak closed 10 years ago

CezaryDanielNowak commented 10 years ago

Hey, In PHP some operators doesn't need parentheses (, ) to work, see the sample:

{{
  include 'sth' // should return `include 'sth';`
  return 'sth' // should return `return 'sth';`
  require 'sth' // should return `require 'sth';`
  if sth //here it's OK
  switch test //here it's OK too
    case 'd'
      ':)'
}}
btwael commented 10 years ago

Soon, Mammouth will be written from zero, because we want to add an artificial intelligence that detect difference between variable, classes and functions...that will help to write PHP website with intelligence.. but I will work to add some of this feature in the current versions

btwael commented 10 years ago

@korpirkor, you can use parentheses ?? like include('sth')

CezaryDanielNowak commented 10 years ago

yeah, sure I can use parentheses  but it's step backwards.

Regarding artificial intelligence: Maybe it isn't needed and mammouth should force user to code using good practices:

btwael commented 10 years ago

yeah, maybe we will use your suggestions, I will work in this, maybe we should write something like ECMA-262, that organize Mammouth development and usage...

btwael commented 10 years ago

See example: http://mammouth.wamalaka.com/#try:{{%0Ahello%20%3D%20%27hello%20%27%0Aecho%20hello%20%27wael%27%0A}}

CezaryDanielNowak commented 10 years ago

yay :) so now just include, include​once, require, require​once and return left

CezaryDanielNowak commented 10 years ago

Looks like return statement stopped working http://mammouth.wamalaka.com/#try:{{%0Atest%20%28%29%20-%3E%0A%20%20if%28foo%29%0A%20%20%20%20return%20%27bar%27%0A}}%0A%0A{{%0Atest%20%28%29%20-%3E%0A%20%20if%28foo%29%0A%20%20%20%20return%28%27bar%27%29%0A}}

btwael commented 10 years ago

Hey @korpirkor, you can now see your example, that's work now

btwael commented 10 years ago

I think that shoud be closed now. tnx you @korpirkor

CezaryDanielNowak commented 10 years ago

@btwael What do you say if I create simple mammouth tests for you, to regression tests ?

btwael commented 10 years ago

@korpirkor, Of courses if you wants and you have time, that well be helpful to make a nice language that compiles to PHP !! tnx again sorry for my english