From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Chaos Eternal Newsgroups: gmane.lisp.guile.user Subject: Re: Python-style doctests in Guile (implemented, please comment) Date: Tue, 01 Aug 2017 01:36:51 +0000 Message-ID: References: <87379d7m66.fsf@web.de> <87zibklcs7.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1501551470 17362 195.159.176.226 (1 Aug 2017 01:37:50 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 1 Aug 2017 01:37:50 +0000 (UTC) Cc: guile-user@gnu.org To: Arne Babenhauserheide Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Aug 01 03:37:45 2017 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dcM7z-000491-9F for guile-user@m.gmane.org; Tue, 01 Aug 2017 03:37:43 +0200 Original-Received: from localhost ([::1]:34033 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcM85-0001L8-78 for guile-user@m.gmane.org; Mon, 31 Jul 2017 21:37:49 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcM7M-0001Kx-1w for guile-user@gnu.org; Mon, 31 Jul 2017 21:37:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcM7K-00021n-Mv for guile-user@gnu.org; Mon, 31 Jul 2017 21:37:04 -0400 Original-Received: from mail-it0-x22b.google.com ([2607:f8b0:4001:c0b::22b]:36408) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dcM7K-00021A-EJ for guile-user@gnu.org; Mon, 31 Jul 2017 21:37:02 -0400 Original-Received: by mail-it0-x22b.google.com with SMTP id 77so668188itj.1 for ; Mon, 31 Jul 2017 18:37:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shlug-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=e8TXoLmXIHYS4UQtpj+l/5z4Va1Sxaokn2I74Ez2IHk=; b=cmC3zDDtA9jfB5ZOM9aP3W7yYW5fq6+4nGkyKjUJgyEh2jUo7W0vuF2AsYkXQ1AyqE 8afMvhWj5ly2u+4y48W0PLbf/2ZzKc4RPRuQUJIcfBUeZicgZvbR4dCz9mTaSTSoYycO lw6l4p/qj0L9gFvyrxXV8gVOFsB6wRi5faEHiiNw6Y1C0K6EnuVnA6BiSuOXV+YbUAnA 8Ux5qSUpdgFqnoon1C8kDKuCMR0083whSumIawNQb7MLdydtsuRCmB8YOgOzkhrcgVfC t1Mu0VzAA6TcU2/LXxzL4LP3cL+hTts/p+bM5GmBcn4xnkf7W8WMcUK+Un9aZl506V6q wHLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=e8TXoLmXIHYS4UQtpj+l/5z4Va1Sxaokn2I74Ez2IHk=; b=otx/7jfkSeonqpI0KD8igDA9gRYz+PePFierR5iTihi4rg9dWv4RXCC9oTkscBTZSW u5SDR6VNViqqYVDrwoXR1x/JBbb475C+7NfPN8XHm0Ei7f1P8Yd0wuX3VlGP3S/Pc2mW Y/mh3b2/15YvlG5zp5jgah6l+51O+LgRYB69Ig+L9B9aFCXyYD/OCVfIKpl4GNhlwQmH E3iuhJqcoWAfDApgwAMsuwq5xsLDTdGwYSIF7R/YumttMpAxMp1WNSKpunOhx940+TCx jPMYIN7WHohhj7uzTvJ0qMPbvHipc8unOlG+LO9db5R1m38IbvkmXhdf2068kS6B5hKl IPfw== X-Gm-Message-State: AIVw112PTquUjre7Fd7u0D2eREnbmDFyfCK9qbTqod2bGQzqJFEjwxEt bUfJB2RStCHHkI7qagdhICBM8crD0YNy X-Received: by 10.36.61.139 with SMTP id n133mr137746itn.37.1501551421547; Mon, 31 Jul 2017 18:37:01 -0700 (PDT) In-Reply-To: <87zibklcs7.fsf@web.de> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4001:c0b::22b 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:14004 Archived-At: No, I don't think so. First, s-exp itself can be very literal written just like the srfi-64: #+begin_src (test 'foo (test-equal 1 (one))) #+end_src the meanning of this code is very straightforward: do a test whether result of (one) equals to 1. and now with my `define-examples=E2=80=98 #+begin_src (define-examples (test 'foo (test-equal 1 (one)))) (define (one) 1) #+end_src this code is also straightforward. and even we can do this: #+begin_src (define-examples (doc "the purpose of one is just return 1") (test 'foo (test-equal 1 (one)))) (define (one) 1) #+end_src IMHO the real problem of putting codes into literal string is that breaks the consistency of lisp, that say, the semantics defined by the embed code can not be extracted with just s-exp reader. on the other hand, the s-exp is the ultimate way to represent structures, and it shall be adopted whenever possible. On Tue, Aug 1, 2017 at 1:46 AM Arne Babenhauserheide wrote: > > Chaos Eternal writes: > > > Great job! > > > > I have a new idea using s-exps to define tests: > > simple way: > > (define-syntax define-examples > > (syntax-rules () ((_ e ...) (quote (e ...))))) > > > > then we can simply (read the-file) then (match e ((define-examples e > ...)) > > (do-test e)) > > So you=E2=80=99d write something like the following? > > (define (foo) > (define-examples > ((foo) 'foo)) > 'foo) > > It has the same limitations as I see for define-with-tests (see my other > answer), do you see advantages over the define-with-tests approach? > > Best wishes, > Arne > -- > Unpolitisch sein > hei=C3=9Ft politisch sein > ohne es zu merken >