From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12258 invoked by alias); 19 Dec 2013 17:50:09 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 12207 invoked by uid 89); 19 Dec 2013 17:50:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-we0-f171.google.com Received: from mail-we0-f171.google.com (HELO mail-we0-f171.google.com) (74.125.82.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 19 Dec 2013 17:50:08 +0000 Received: by mail-we0-f171.google.com with SMTP id q58so1445932wes.30 for ; Thu, 19 Dec 2013 09:50:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=qNWThiaOqcMxglbgnqrDEPQ11roJ2Wz/TuQk6Ef1tFc=; b=ZqV2NbuNpEtXOqg4g0M8NKdQFbUyhYgRrgl4DPB3wHSeF/jUQvKMr5tzfiih2kQjQp 5qJrDMdro+yIyh/dKit96h/H4EAbHluPRtcWhiaBl1VEdTkgNhMGUX3riqX8t+EmNLOR UZpXOyCXoF+X7gGMlIltUjeXi5xMxA/7rSLhJx68mBJcfQHq6IUz3ZjF83xJ0QWwzQwC 77Sm5iDSg0/FZLElojCez5NebhMQrWTdvrnZ/2YWBBoTuynSfLDCXGPGxVLUhuyPBMYO SuMePjqTPmt/4/VkxgMCLafPD+X5X+HkjYXAxLxS3UQ7UgNSRyl6A9Xo54wCqAkdQoCF dvcA== X-Gm-Message-State: ALoCoQkjS8sgaah7x/PBae8GeqUaheakjdZKS3hWe+lgNpikHAmfuVcoWygAfjBxhj6MWU0KUvPFlNqdREVuGWdz+/iLQ8O5/f8L2qRFyKeN4EcJiwV1mZ1sPMNl6RVrRPY7l35QoiElboeY84CEsSbnR1vsXQSDk0u7NrPz5TLdTe9jCe8u+1rOHSn7Cjxbu1gUvgsOb+esuyJWARvjYi1EcBqmGQNpRg== MIME-Version: 1.0 X-Received: by 10.180.105.199 with SMTP id go7mr3490287wib.53.1387475404695; Thu, 19 Dec 2013 09:50:04 -0800 (PST) Received: by 10.14.151.72 with HTTP; Thu, 19 Dec 2013 09:50:04 -0800 (PST) In-Reply-To: References: <871u1j2ldi.fsf@fleche.redhat.com> Date: Thu, 19 Dec 2013 17:50:00 -0000 Message-ID: Subject: Re: [RFC/Patch] Call overloaded operators to perform valid Python operations on struct/class values. From: Siva Chandra To: Doug Evans Cc: Tom Tromey , gdb-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00785.txt.bz2 dje> smart_ptr = gdb.parse_and_eval ("my_smart_ptr"); dje> dereferenced_smart_ptr = gdb.parse_and_eval("*%V" % smart_ptr) siva> Should work. May be the '%' syntax would not (I am not sure). But, we siva> could consider other alternatives [Replace occurrences of $1, $2, etc siva> for example]. siva> Is this an exhaustive solution or a cool fallback option when no other siva> Pythonic way works dje> Both? dje> [Not sure I understand the question.] I do think it is exhaustive. But, somehow [only a subjective feeling], seems like a fallback option. For example, it makes simple things (like, val1 + val2) more verbose and less readable. It is something which one could fallback to if they want to do non-Python operations.