From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jan Wedekind Newsgroups: gmane.lisp.guile.user Subject: Re: Artanis web REPL Date: Sat, 25 Jun 2016 21:09:45 +0100 (BST) Message-ID: References: <1466788813.1489.61.camel@gmail.com> Reply-To: Jan Wedekind NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1466885427 4251 80.91.229.3 (25 Jun 2016 20:10:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 25 Jun 2016 20:10:27 +0000 (UTC) Cc: guile-user@gnu.org To: Nala Ginrut Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Jun 25 22:10:19 2016 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bGtuE-0002g7-4Y for guile-user@m.gmane.org; Sat, 25 Jun 2016 22:10:18 +0200 Original-Received: from localhost ([::1]:51338 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGtuC-0002jn-Qr for guile-user@m.gmane.org; Sat, 25 Jun 2016 16:10:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGttr-0002jW-0C for guile-user@gnu.org; Sat, 25 Jun 2016 16:09:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGttm-0006W1-Jl for guile-user@gnu.org; Sat, 25 Jun 2016 16:09:53 -0400 Original-Received: from basicbox4.server-home.net ([195.137.212.26]:52129) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGttm-0006Ut-Cy for guile-user@gnu.org; Sat, 25 Jun 2016 16:09:50 -0400 Original-Received: from wedemob.default (unknown [95.150.201.158]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by basicbox4.server-home.net (Postfix) with ESMTPSA id 641171530663; Sat, 25 Jun 2016 22:09:46 +0200 (CEST) X-X-Sender: jan@wedemob In-Reply-To: User-Agent: Alpine 2.11 (DEB 23 2013-08-11) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 195.137.212.26 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:12703 Archived-At: Ah, sorry. I didn't understand earlier. No problem, I'll wait with the changes then. On Sat, 25 Jun 2016, Nala Ginrut wrote: > Yes, that's what I said emberrass bugs. I will fix it next release. Ple= ase > use the old method for a while. > > Best regard. > > Jan Wedekind =E4=BA=8E2016=E5=B9=B46=E6=9C=8825=E6=97=A5= =E5=91=A8=E5=85=AD 05:51=E5=86=99=E9=81=93=EF=BC=9A > >> Actually I had to revert the ":from-post" code as well, because it was >> always giving the same result for "line" after the first post event. >> >> (post "/" >> (lambda (rc) >> (let* [(session (cookie-ref (rc-cookie rc) "sid")) >> (post-data (map dot (generate-kv-from-post-qstr (rc-bo= dy >> rc)))) >> (line (uri-decode (assoc-ref post-data "line")))] >> (repl session line) >> (editor session)))) >> >> On Sat, 25 Jun 2016, Nala Ginrut wrote: >> >>> Hi Jan! >>> First, thanks for sharing this code. >>> I've tried, it's sweet that I love it! >>> And I'm looking forward to someone could finish it as a complete >>> project just like IPython notebook or similar. >>> >>> On Fri, 2016-06-24 at 12:43 +0100, Jan Wedekind wrote: >>>> >>> (post "/" >>>> (lambda (rc) >>>> (let* [(session (cookie-ref (rc-cookie rc) "sid")) >>>> (post-data (map dot (generate-kv-from-post-qstr (rc- >>>> body rc)))) >>>> (line (uri-decode (assoc-ref post-data >>>> "line")))] >>>> (repl session line) >>>> (editor session)))) >>> >>> >>> It is embarrassing when I'm trying to point out the fancy "shortcut" >>> for saving code, but finally I realized there're bugs. ;-( >>> Anyway, they're just syntax sugar for convenience, it won't be harm i= f >>> you dismiss it. I'm working on the server core of Artanis, so I may f= ix >>> it next release. >>> But I still put my code here to shed some light. ;-P >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3Dcode=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> (post "/" #:from-post #t #:cookie '(name repl) >>> (lambda (rc) >>> (let [(session (:cookies-ref rc 'repl "sid")) >>> (line (uri-decode (:from-post rc 'get "line")))] >>> (repl session line) >>> (editor session)))) >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3Dend=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> >>> >>> Best regards. >>> >>> >