Received: by 10.204.13.78 with SMTP id b14mr84383bka.5.1318322789882; Tue, 11 Oct 2011 01:46:29 -0700 (PDT) X-BeenThere: liftweb@googlegroups.com Received: by 10.204.240.17 with SMTP id ky17ls1670937bkb.3.gmail; Tue, 11 Oct 2011 01:44:28 -0700 (PDT) Received: by 10.204.140.67 with SMTP id h3mr1575834bku.3.1318322668323; Tue, 11 Oct 2011 01:44:28 -0700 (PDT) Received: by 10.204.140.67 with SMTP id h3mr1575833bku.3.1318322668307; Tue, 11 Oct 2011 01:44:28 -0700 (PDT) Return-Path: Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com [209.85.214.53]) by gmr-mx.google.com with ESMTPS id a16si3698148bku.3.2011.10.11.01.44.28 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 11 Oct 2011 01:44:28 -0700 (PDT) Received-SPF: pass (google.com: domain of hedef...@gmail.com designates 209.85.214.53 as permitted sender) client-ip=209.85.214.53; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of hedef...@gmail.com designates 209.85.214.53 as permitted sender) smtp.mail=hedef...@gmail.com; dkim=pass (test mode) header...@gmail.com Received: by bkbzt12 with SMTP id zt12so10850310bkb.26 for ; Tue, 11 Oct 2011 01:44:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=hmkFMa+/xDIE8qQJSVx44QCNe+slkYfWeX/vbYYteXg=; b=HsC5n5VGzDlprOCsiMMLjNQsBZtTyXRwofATWi0CAhS/kVtFkeN92VyY8ipYqe6Cb1 PFVaAH3NALVNAc5omzCSsC0zIkVlGzirXycq7yUHw1N4h5xfRlw8znL/pu+diCuAX2iY RwD/Vq/ttpu3wg/0muWxX7QT8GwRtq6/6wfWM= Received: by 10.204.136.12 with SMTP id p12mr8799944bkt.26.1318322667330; Tue, 11 Oct 2011 01:44:27 -0700 (PDT) Return-Path: Received: from hedefalk-mbp.local (h-235-32.a149.priv.bahnhof.se. [85.24.235.32]) by mx.google.com with ESMTPS id z9sm20328267bkn.7.2011.10.11.01.44.25 (version=SSLv3 cipher=OTHER); Tue, 11 Oct 2011 01:44:26 -0700 (PDT) Message-ID: <4E9401E8.7080...@gmail.com> Date: Tue, 11 Oct 2011 10:44:24 +0200 From: Viktor Hedefalk User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: liftweb@googlegroups.com Subject: Re: [Lift] Re: Help understanding RestHelper serve params References: <4E8EEDE7.1050...@thewordnerd.info> <33266887.2093.1318020049376.JavaMail.geo-discussion-forums@yqnv12> <4E938537.30...@thewordnerd.info> In-Reply-To: <4E938537.30...@thewordnerd.info> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit > What Scala magic is it that doesn't require a "," between Nil and > JsonGet? I always want to enter it because I'd assume those are > separate arguments in some unapply() extractor or other. > Actually Peter mentioned that too: "Great, now this is it! The unapply method takes our mythical Req that the handler PartialFunction is referring to and returns an Option[(List[String], Req)]. Now, I've never written an unapply method that has a Tuple2 in its Option, but apparently if you do then the first element can be referenced before the object and the second after." I looked it up because I had for some reason forgotten about it even though I have used the exact same thing with combinator parsers. There it's used with a case class ~ for sequential composition which allows you to match something like a ~ b ~ c when constructing your AST. In the lang spec it's described under: 8.1.10 InfixOperationPatterns http://www.scala-lang.org/sites/default/files/linuxsoft_archives/docu/files/ScalaReference.pdf It's basically a special case for extractors to allow for infix notation. It applies to constructor and extractor patterns. And it's not even only for binary patterns, x e (y, z) => e(x, y, z) too. That I think would be confusing though� :) Thanks, Viktor