From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by sourceware.org (Postfix) with ESMTPS id 8D9843858D33 for ; Tue, 17 Oct 2023 07:23:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8D9843858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8D9843858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::52a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697527430; cv=none; b=YILCOvclzLsP65A1hryyCte8sHot5s3uqhB4lX/7YZFQj8f4fyFJ6rM1U/DUaBxX8JZrVxe5DwWhyDtdv0VKhQUGiucJJw3zzsf+9Y7E0rWNc9rt8jEelDoav57S7cH8a1ZBcelXP99BzBa05vRBYhZL45O0f1yEvUuS/GhkK+w= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697527430; c=relaxed/simple; bh=L5kMTB+MHGhtFBdWJGOgPF/YrqGOIkJV9dvrf9RSEKU=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=xHm4sTnU8UXkjxYi01kvvpdGeZht/OntpeLvapI0HY8WQ904pkhcnDOvy2dQAR8GQZ3cZ3Ur7WVmsTLpXVz3mdtlDuIATSISvzpP1bKD3FAUxwXFl8tEYeS4wTBxliohKriomeuqC57nuWe5/atpnmOj+9us3VzMKyGBgId8toM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-53406799540so9276618a12.1 for ; Tue, 17 Oct 2023 00:23:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697527427; x=1698132227; darn=sourceware.org; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=3FxCyLZZAj5MqotFZnQkUR3x+8zbDg2VD07J4I7ZRCM=; b=Flrv8k+qBUxZWfEXMYq7Z166Ib8NMNkO+0MbGugvVhb2p2aTe5KRWhO287w5ZJXk7L rklkrpOMAqFlU/9GfK+5Xhs6YBZGGIqqrCzAtYF5velBEJEHJ1HkGldYyi2u1Lxmb9Ce 9ANLjyNQ3jntyygNX3C1MvWPaGh2ZSwqQnZG7JjzaAjzQoLSe12tzpxj88SsXcQQCwfy qkGnRQaSQrGIW50lN2RSGRccwNnsv4l6nJhu1MO6o+AcaAvnT86gXnP8uhJHJB3q6uYj BdCRsJQDqFsCUeMs23H2N6g7P4dQ+6VtByoo54f0y/6kmc3VMbuDNJyMI3g8Abijl1xw d+Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697527427; x=1698132227; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3FxCyLZZAj5MqotFZnQkUR3x+8zbDg2VD07J4I7ZRCM=; b=MZy9yOVJXylLPm+jeKFWVL+2TmojMmGBE61F6lQckC+M05QfixZCG4uIMBZIbSDJBH IwFEy5wGFVgUxtm+mn6KDnWzIGCreAMn020wAo5HzYVuEXOYxXePmOFXtaTVctq1jNFJ pZBQL7BclhruljpTUJ8KrL3LODfS4vzTKdOS3nui+nKkoLIjSGKCliSzlA4ZMX65lXU7 pvglK74H+DvIZFQXJ5I8yctNccj1VVLAH3NKc0apCFxCKjKf6QwxnC6Xg9EIYjPbE7og 7dKX2qsbsApuVFs1aOG/PlMyf3vndWzL84duv4Fz+5BpVMXNwljEh1aeLfYBZ/lL9S9v 0NFA== X-Gm-Message-State: AOJu0YzHtQq59kBRKh15kNLEThCqanm5LthSdmlODpulfQptDyJDKHP7 I8oyA9iQX8fj/b1bHIvRqC7j+xl50fdJJ98z8md6P3Xe6zo= X-Google-Smtp-Source: AGHT+IFw3TwXK0izow7XIHG1tXjSxLl6F1Xjp9CExBJE4V1zOINRW/rYxQk4waqjCZ3hQAN1WLauW9knEi+KV+fVbNY= X-Received: by 2002:a17:906:c14f:b0:9be:bf31:335f with SMTP id dp15-20020a170906c14f00b009bebf31335fmr1027779ejc.46.1697527426850; Tue, 17 Oct 2023 00:23:46 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Damien Mattei Date: Tue, 17 Oct 2023 09:23:35 +0200 Message-ID: Subject: Re: pprint bug ? To: kawa mailing list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: when outputting in REPL,things looks better: #|kawa:30|# (display '(v::vector)) (v :: vector) #|kawa:31|# (write '(v::vector)) (v :: vector) #|kawa:32|# (pprint "hello") hello #|kawa:33|# (pprint '"hello") hello #|kawa:34|# (pprint (write '"hello")) "hello" On Tue, Oct 17, 2023 at 9:11=E2=80=AFAM Damien Mattei wrote: > > i have this code: > > (require 'srfi-1) ; any,every > (require 'srfi-69) ;; hash table > > ;; try include , use include-relative if problems > (include "../../Scheme-PLUS-for-Kawa/rec.scm") ; rec does not exist > in Kawa (no SRFI 31) > (include "../../Scheme-PLUS-for-Kawa/def.scm") > (include "../../Scheme-PLUS-for-Kawa/set-values-plus.scm") > (include "../../Scheme-PLUS-for-Kawa/for_next_step.scm") > (include "../../Scheme-PLUS-for-Kawa/declare.scm") > (include "../../Scheme-PLUS-for-Kawa/condx.scm") > (include "../../Scheme-PLUS-for-Kawa/block.scm") > (include "../../Scheme-PLUS-for-Kawa/not-equal.scm") > (include "../../Scheme-PLUS-for-Kawa/exponential.scm") > (include "../../Scheme-PLUS-for-Kawa/while-do-when-unless.scm") > (include "../../Scheme-PLUS-for-Kawa/repeat-until.scm") > (include "../../Scheme-PLUS-for-Kawa/modulo.scm") > (include "../../Scheme-PLUS-for-Kawa/bitwise.scm") > > > (include "../../Scheme-PLUS-for-Kawa/slice.scm") > > (include "../../Scheme-PLUS-for-Kawa/scheme-infix.scm") > > (include "../../Scheme-PLUS-for-Kawa/assignment.scm") > (include "../../Scheme-PLUS-for-Kawa/apply-square-brackets.scm") > > (include "../../Scheme-PLUS-for-Kawa/array.scm") > > > ;; (matrix #(1 2 3)) > ;; matrix@4612b856 > > > (define-simple-class matrix () > > (v::vector) > > ((*init* (vParam::vector)) > (set! v vParam)) > > ) > > > ;; (define M (create-matrix-vect-by-function (lambda (i j) (+ i j)) 2 3)) > (define (create-matrix-vect-by-function fct lin col) > (matrix (create-vector-2d fct lin col))) > > ;; (matrix-v M) > ;;#(#(0 1 2) > ;; #(1 2 3)) > (define (matrix-v M) > (slot-ref M 'v)) > > > > (define (matrix-vect-line-ref M lin) > {v <+ (matrix-v M)} > {v[lin]}) > > i run: > > kawa curly-infix2prefix.scm ../AI_Deep_Learning/kawa/matrix+.scm > (require (quote srfi-1)) > (require (quote srfi-69)) > (include "../../Scheme-PLUS-for-Kawa/rec.scm") > (include "../../Scheme-PLUS-for-Kawa/def.scm") > (include "../../Scheme-PLUS-for-Kawa/set-values-plus.scm") > (include "../../Scheme-PLUS-for-Kawa/for_next_step.scm") > (include "../../Scheme-PLUS-for-Kawa/declare.scm") > (include "../../Scheme-PLUS-for-Kawa/condx.scm") > (include "../../Scheme-PLUS-for-Kawa/block.scm") > (include "../../Scheme-PLUS-for-Kawa/not-equal.scm") > (include "../../Scheme-PLUS-for-Kawa/exponential.scm") > (include "../../Scheme-PLUS-for-Kawa/while-do-when-unless.scm") > (include "../../Scheme-PLUS-for-Kawa/repeat-until.scm") > (include "../../Scheme-PLUS-for-Kawa/modulo.scm") > (include "../../Scheme-PLUS-for-Kawa/bitwise.scm") > (include "../../Scheme-PLUS-for-Kawa/slice.scm") > (include "../../Scheme-PLUS-for-Kawa/scheme-infix.scm") > (include "../../Scheme-PLUS-for-Kawa/assignment.scm") > (include "../../Scheme-PLUS-for-Kawa/apply-square-brackets.scm") > (include "../../Scheme-PLUS-for-Kawa/array.scm") > (define-simple-class matrix () (|v::vector|) > ((*init* (|vParam::vector|)) (set! v vParam))) > (define (create-matrix-vect-by-function fct lin col) > (matrix (create-vector-2d fct lin col))) > (define (matrix-v M) (slot-ref M (quote v))) > (define (matrix-vect-line-ref M lin) (<+ v (matrix-v M)) (bracket-apply v= lin)) > > now my problem is with : |v::vector| > > | | appears > > the routine that print is : > > ; parse the input file from command line > (define cmd-ln (command-line)) > ;;(format #t "The command-line was:~{ ~w~}~%" cmd-ln) > (define file-name (car (reverse cmd-ln))) > > (define code-lst (literal-read-syntax file-name)) > > (define (prt-expr expr) > (pprint expr) > (newline)) > > (define (dsp-expr expr) > (pprint (write expr)) > (newline)) > > (define do-not-display-result (map dsp-expr code-lst)) > > i do not know how to get rid of | | without loosing " " and keeping inden= tation > > On Tue, Oct 17, 2023 at 8:49=E2=80=AFAM Damien Mattei wrote: > > > > in fact guile and racket act the same way: > > > > scheme@(guile-user)> (display '(include "../../Scheme-PLUS-for-Kawa/rec= .scm")) > > (include ../../Scheme-PLUS-for-Kawa/rec.scm) > > > > Welcome to DrRacket, version 8.9 [cs]. > > Language: racket, with debugging; memory limit: 8192 MB. > > (display '(include "../../Scheme-PLUS-for-Kawa/rec.scm")) > > (include ../../Scheme-PLUS-for-Kawa/rec.scm) > > > > :-( > > > > i just want to output code with indentation ,if i do it with 'write' > > ,i loose indentation, if i do it with 'display' or 'pprint' i get > > indentation but code is no more valid as string are without " ". > > > > On Mon, Oct 16, 2023 at 11:52=E2=80=AFPM Damien Mattei wrote: > > > > > > hello, > > > i find something strange in pprint: > > > > > > (import (kawa pprint)) > > > (pprint '(include "../../Scheme-PLUS-for-Kawa/rec.scm")) > > > > > > will output: > > > (include ../../Scheme-PLUS-for-Kawa/rec.scm) > > > > > > which is no more an s-expr , it has wiped out the " " of the string, > > > and it is bugging my code > > > > > > isn't it more normal to output: > > > (include "../../Scheme-PLUS-for-Kawa/rec.scm") > > > > > > ?