Return-Path: X-Original-To: apmail-freemarker-notifications-archive@minotaur.apache.org Delivered-To: apmail-freemarker-notifications-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 32F691897F for ; Tue, 10 Nov 2015 00:34:14 +0000 (UTC) Received: (qmail 58790 invoked by uid 500); 10 Nov 2015 00:34:14 -0000 Delivered-To: apmail-freemarker-notifications-archive@freemarker.apache.org Received: (qmail 58716 invoked by uid 500); 10 Nov 2015 00:34:14 -0000 Mailing-List: contact notifications-help@freemarker.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@freemarker.incubator.apache.org Delivered-To: mailing list notifications@freemarker.incubator.apache.org Received: (qmail 58610 invoked by uid 99); 10 Nov 2015 00:34:14 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Nov 2015 00:34:14 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 9EC2F1809F6 for ; Tue, 10 Nov 2015 00:34:13 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.97 X-Spam-Level: X-Spam-Status: No, score=0.97 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id cxjGAcpVtYoQ for ; Tue, 10 Nov 2015 00:34:12 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id 1094A206E8 for ; Tue, 10 Nov 2015 00:34:11 +0000 (UTC) Received: (qmail 57038 invoked by uid 99); 10 Nov 2015 00:34:11 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Nov 2015 00:34:11 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 119DE2C14F8 for ; Tue, 10 Nov 2015 00:34:11 +0000 (UTC) Date: Tue, 10 Nov 2015 00:34:11 +0000 (UTC) From: "Daniel Dekany (JIRA)" To: notifications@freemarker.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FREEMARKER-8) Adding to a hash (map) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FREEMARKER-8?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D14= 997740#comment-14997740 ]=20 Daniel Dekany commented on FREEMARKER-8: ---------------------------------------- That's known but though one. FreeMarker doesn't access {{Map}}-s directly, = instead it uses {{TemplateModel}} interfaces like {{TemplateHashModelEx}}. = Those has no methods for modifications. Of course we could add something li= ke {{WritableTemplateHashModelEx}} which extends {{TemplateHashModelEx}}, a= nd then also had to update some of the built-in functions which assume that= these models are immutable. But before doing anything like that, there's a= nother higher priority issues, adding a model interface that allows non-str= ing keys (would be certainly called {{TemplateMapModel}}), and then extend = that inferface to have writable variation. > Adding to a hash (map) > ---------------------- > > Key: FREEMARKER-8 > URL: https://issues.apache.org/jira/browse/FREEMARKER-8 > Project: Apache Freemarker > Issue Type: New Feature > Components: engine > Affects Versions: 2.3.23 > Reporter: Ondra =C5=BDi=C5=BEka > > It would be nice to assign to a map this way: > {code} > <#assign map["key"] =3D 1> > {code} > and also=20 > {code} > <#assign map["key"]++> > {code} > So far I think it's like this but can't get it work: > {code} > <#assign map +=3D {classification.classification : map[classification.cla= ssification]!++}> > {code} > Thanks for considering. -- This message was sent by Atlassian JIRA (v6.3.4#6332)