Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45723 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91847 invoked from network); 11 Oct 2009 10:24:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Oct 2009 10:24:40 -0000 Authentication-Results: pb1.pair.com header.from=indeyets@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=indeyets@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.227 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: indeyets@gmail.com X-Host-Fingerprint: 209.85.219.227 mail-ew0-f227.google.com Received: from [209.85.219.227] ([209.85.219.227:46504] helo=mail-ew0-f227.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0D/51-18143-662B1DA4 for ; Sun, 11 Oct 2009 06:24:39 -0400 Received: by ewy27 with SMTP id 27so3551001ewy.23 for ; Sun, 11 Oct 2009 03:24:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=yoAd6+sTMek/cNClx7SUJ4IOraK755wBq+V/5M0cW10=; b=ZUrLUT+U4Zh3knqx7IulzYI0qY+pW/fdhEKuqdxHrk/s1U4EDRKuiajDY4WZAxUJ4c nZIMtCjAc314ycfU2kLKKJnImOWNBDTBQSM0vXlWzw48UpTKvN3A5bacCeq0ky1Qm+ex CKqi7Kr+64C4iBfivj1WhWTP7ns6iqtewhrVY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=UYrP5voW0R0JA1Q2rd+iFHz7fnKn3mCqfSEff0trZzQD2T1jTQik18BGu04rEgEt2o wWPaixi2amRGnZZcWgLDIU0yeeRgVcEWx+n4V9ZwUF1LWeqNPWZ8U8Ixnjbbbkj1QoWF SNKRSwo/XEsMgGj7TjOUrSV3k9pqftC1+rX9Y= Received: by 10.210.60.13 with SMTP id i13mr2773611eba.8.1255256676182; Sun, 11 Oct 2009 03:24:36 -0700 (PDT) Received: from nirvana.lan ([93.185.190.227]) by mx.google.com with ESMTPS id 5sm5239770eyh.0.2009.10.11.03.24.34 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 11 Oct 2009 03:24:35 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes In-Reply-To: <9db916bc0910101434x507e05b9r2651eaa67f833164@mail.gmail.com> Date: Sun, 11 Oct 2009 14:24:32 +0400 Cc: internals@lists.php.net Content-Transfer-Encoding: 7bit Message-ID: <0B02A3B0-ED1F-40CC-AC55-D6D191C86715@gmail.com> References: <9db916bc0910101434x507e05b9r2651eaa67f833164@mail.gmail.com> To: Rune Kaagaard X-Mailer: Apple Mail (2.1076) Subject: Re: [PHP-DEV] Re: Creating an experimental syntax From: indeyets@gmail.com (Alexey Zakhlestin) On 11.10.2009, at 1:34, Rune Kaagaard wrote: > Dear Internals > > At the moment I'm very inspired by functional programming languages > such as SML and especially scala. I would like to create and > alternative PHP syntax, just for fun nothing serious, inspired by > these languages. I've managed to compile PHP with debug stuff turned > on and found some files called zend_language_scanner.l, > zend_language_parser.y and did succed with creating an alias for > "function" called "def". I now wanted to change the function > definition into something more scala looking: > > def max($x, $y) = { > if ($x > $y) return $x else return $y > } > > but got completely stuck. > > I realised all of a sudden that I really don't understand anything > about what is going on in these files. Not even enough to ask good > questions. What should I do/read/study/buy/etc... ???? > > Thx in advance from a very confused dude that is in way over his head Well, in case of php-5.3+ there is partial support for functional paradigm. try this: $y) return $x; else return $y; }; echo $max(5, 1); echo $max(4, 99); ?> http://docs.php.net/manual/en/functions.anonymous.php