[Thread Prev][Thread Next][Index]
Re: [ferret_users] trailing slash in symbol
- To: Ryo Furue <furue@xxxxxxxxxx>
- Subject: Re: [ferret_users] trailing slash in symbol
- From: Marco van Hulten <Marco.Hulten@xxxxxx>
- Date: Sat, 20 Jun 2020 21:55:06 +0200
- Arc-authentication-results: i=4; mx.google.com; dkim=pass header.i=@uib.no header.s=20160927 header.b=YCJ2Y5OY; arc=pass (i=2 dkim=pass dkdomain=uib.no); spf=softfail (google.com: domain of transitioning marco.hulten@xxxxxx does not designate 209.85.160.198 as permitted sender) smtp.mailfrom=marco.hulten@xxxxxx
- Arc-authentication-results: i=3; mx.google.com; dkim=pass header.i=@uib.no header.s=20160927 header.b=YCJ2Y5OY; arc=pass (i=2 dkim=pass dkdomain=uib.no); spf=softfail (google.com: domain of transitioning marco.hulten@xxxxxx does not designate 209.85.160.198 as permitted sender) smtp.mailfrom=marco.hulten@xxxxxx
- Arc-authentication-results: i=2; mx.google.com; dkim=pass header.i=@uib.no header.s=20160927 header.b=YCJ2Y5OY; arc=pass (i=1 spf=pass spfdomain=uib.no dkim=pass dkdomain=uib.no dmarc=pass fromdomain=uib.no); spf=softfail (google.com: domain of transitioning marco.hulten@xxxxxx does not designate 65.153.203.166 as permitted sender) smtp.mailfrom=Marco.Hulten@xxxxxx
- Arc-authentication-results: i=1; mx.google.com; dkim=pass header.i=@uib.no header.s=20160927 header.b=YCJ2Y5OY; spf=pass (google.com: domain of marco.hulten@xxxxxx designates 2001:700:200:30::141 as permitted sender) smtp.mailfrom=Marco.Hulten@xxxxxx; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=uib.no
- Arc-message-signature: i=4; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-archive:list-help:list-post:list-id:mailing-list:precedence :message-id:content-transfer-encoding:mime-version:importance :organization:references:in-reply-to:subject:cc:to:from:date:sender :dkim-signature; bh=BiR0bJ8xeGkfZERP6aI0WSGHUraAP2o+Iu94pm/H0QE=; b=P6oxR8UlSz7xJZcPmp+NvKIc/TaiMirUbYnr+vYQL886kSjvel53NuUNs07BHiSE1T UdSd/AJs36HSkzraaaVnm3oH+NOlJsmqXZq72XcKGS5viQ1AwztdJHbx6hFSD6hRWZbJ bptZLZZv3TNSttI19pv0pPxLXj1/mV+yKGpKBDweSxW/6DywlDpktV6Mv9G5907VkGdm I4c9MAHyMbMtLBjbtDnMsvSfG52ezvDl0lRZ0oNvJs5u1ZuLXs9dprOp090OxmB1Otl3 /4Q3w+lhwt7+QrzT/0dFXCXBBros9kUvcXlhCU5F2fnyeCZs39DXPc5CJvsOUrB4CLn+ Or1w==
- Arc-message-signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:content-transfer-encoding:mime-version:importance :organization:references:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=BiR0bJ8xeGkfZERP6aI0WSGHUraAP2o+Iu94pm/H0QE=; b=HFV5XKA2xoTu8QMJAWJqG0qRxbPFPhzlQrnTbpcz1LBbjZfXOzC51ptxXIzHiQlbDq BCq7LB2GettISe443RvYB0UYWLoCqRInBmoqeB679yuY9jlu3ea1iVjJs0sKE7USzm8v 4DP7yexLEWCQAo50NLrq0LdeKeSXqBzsww1mXL5METzrShC8O8DMYEljWUEUuy6HgWCu OQSqBE3jueozp4oo3C+xgAlaPISD20bzivRJwtug2GQVCkA0bdOyqDUcJuh7MkAgUUst 4x10YqEc0W6pFxKc77Sf4IWTafL++WqqiqqF/jCFWv7ByIJzu0s3eJIFbmTKN7hsyX2f fj4A==
- Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:importance:organization :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=BiR0bJ8xeGkfZERP6aI0WSGHUraAP2o+Iu94pm/H0QE=; b=qhPcQsnv4PrIJGDQBrC2gxeOQDwtrHzijydP97GQNSiOcu5Z4NyZieBfCxrFM8RmpH oswXLypf+7Hn4qfLRsJ54eZl6dOjhSvVXW96+zphIugJIaSgLEqxe5oSurJ16TK+Ytjk 5hmqnFuvBIAJZMOUOIpTHFOeMnyZ4K4FQYr9rhWFSJUZPopeCnsR9Nnl28r7x9RCVoFz SYfFm9cSSP8R0iJQcF0idHHklPPFuK+LFr7sukexX4aA2iGFelOaHva5aLVkJ/Qna/Ba hvlx0HkKxCxvpyfHXJDsMfqfHCAajitDnNlX8ZRmJI3qcGK04lvxCLWjugWDzHYyjq5A BLJg==
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:importance:organization :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=BiR0bJ8xeGkfZERP6aI0WSGHUraAP2o+Iu94pm/H0QE=; b=m5nAvEKN84ZI59d5lINbC0qFpNNPZT2fyz7kWFKkmVhPJIkohoFLoPLXH8WjBRWLFC 8dXS3b1OYtk/7Jxm6Uv5ruPtKSuARkV37VyiuGA4WREoy4EcW0lMSuXQrzPa3zS6PC2J MNksz8dD8tjVupc8vP7Ni/YTga4hQvxiV7U/fGlXDInMikkC5zxNw2oVp8nxZQOfTz3Q 2hLXd+i3lo6g7Z9hfMUW4hwxSxGec6+2ydD4uhpjiIJCSgBrekbbiCM38W09PF5MNJqm dR+Gaj0mzRKgjc5k9uSBqyavhOllDknVeNDDAcplQOA1spHtTQKENQL63dSDNl3yMkUs BGzQ==
- Arc-seal: i=4; a=rsa-sha256; t=1592682918; cv=pass; d=google.com; s=arc-20160816; b=DZe795ehWfrONVqiaXXD/StO+IcXaqgsO73lpWi4VHF1cck0VLcgC2LMbxhdgH+pIv IPYQVXpXN88Wxd9h6+L/zkhvvBgrB067PGIK87ASTOhl+wkwbRCF7h1ZARwP/F5XaN0M SrsSre9/qijTph2v+AVUK2yvO/CwHMp3Tg0lUhY7QubXye0GKN5dZ3W7P38VAYhu0D4I s7Vg7g7tO2y67i/3C61sIvbmcJZzeLkSHS18Y5AXMwSE793mngeuXwnkzFY5hUzzRqcV R3wEQdkW8BZcx3Ho3vGYWDvC/yIWdw6O624iRINOx2bgxn9SJi0fyyhJ15qPn/9s+bu8 ynUQ==
- Arc-seal: i=3; a=rsa-sha256; t=1592682917; cv=pass; d=google.com; s=arc-20160816; b=riUP3GXcHotrc1kPYaosNiRWpoCyNCOdIEUyeKVcRgvWJ4HDC2IGzDvaPdhxfgjc6m ZCa6ZWHrVP90XdLkcVP98Y0NPDyRRbb3u/Hh6h7M/47tFjlFYeppnVvxOJ6Vi4AUPtVe fiYuDd3dYjx4kL6FswCkQYE6Zo7cJRy69UtyL+4/vFkuE3bYVDDUZPDeMh7/+bBd9sVX IeV9agIlB2lppOh/iC+6xwBHp9GoV39OoT+ZymB5O1HeFOU1qr6kcS/01thxn4T4h3FT a7qx3lLUzGeWauqDt8ez68LX6cpgOhNhc+GGC33YZkPrW8wqDrWSBs5kapaoQRWr0Bku haFw==
- Arc-seal: i=2; a=rsa-sha256; t=1592682912; cv=pass; d=google.com; s=arc-20160816; b=omlarA2Coajz1kcZkOe2x4iB11nnBAusmsp13NUFJDjH60MkeCMldrYYGbdQHrN9OS SHtWQdG7mZ6YW80n0BuIghGjsqXPN0VMBC8ADuTP7nOCsL9s24994nmZny86eovuzdbF 2JWEP6+pp3YOGoETiSnlTgpQu0GyuBekVPD2H0+15MC6wtrCY6+GEVgoUwzpAeqf4lKa Q5Af3kcGyfMTcmc6WesP0fAs5DLBPjXVPgKvGXHg5lp27qnhTsddbhmCo4yxCPlAGgj6 c7dMSb7aincbbhE1WyEgcD++TJ98ieYu8QtaTptAjxL7Y8A92/snsgibMBuEENJCe568 fv9w==
- Arc-seal: i=1; a=rsa-sha256; t=1592682910; cv=none; d=google.com; s=arc-20160816; b=Lc7keeSq1/SzZfrzQ6kvLWEGeKKADqOCeq20mE2NYKNMqmQYA3xVnuGPyPnI3Isz9N WkuzGXclgTw4qjjqj2w6++kG2Q0ppACVfUb4PBWEsXVt1wF30/FYNbqXS4NrJUzbTCIJ LydrR+E+hdEKVPwdW0RON9g1pcoombJAHcYT+477Qn3CmOlgdhnW+7D2TpH7n/IvuGnM 6FPW+7mvzvtBKXWeinLak24C5xU0pfuypWpZ1cilcPbHfEfquWmOEv4X2NHnGZAUxaLY TunJ7HCiTClyG2lkfPr+OQOt0saQVQoWOLItVQW1Kz4y5aXbp03ebOj55JeECPp1GVLR KG7A==
- Cc: ferret <ferret_users@xxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=noaa.gov; s=google; h=sender:date:from:to:cc:subject:in-reply-to:references:organization :importance:mime-version:content-transfer-encoding:message-id :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive; bh=BiR0bJ8xeGkfZERP6aI0WSGHUraAP2o+Iu94pm/H0QE=; b=VZ736rR8VLpqB1LDZQ7Q/wqVFSeBAd7jjlRyP46L7vdfmptFnbs6DbRjLIwLr6m/sl Op7odamjEvD22vmO2my++FpuUynn+zBs4wYRJz3dTSLFY4BY75+EO1s+XHZeuxrzMBK2 d4SFQj6Y+AFFz8aCLjIPFEFUiWUjg1noetUcLQSDrtvqC7ihB8RAWreX0QgvWneyq9Z2 AgOx2jB0xMPFCVZfS0eaZtTEY8kFCWCK7leYuS7cmDrmwzRHCNYsf+wGqeG4V9GT55LB N8s02xuWKtYLJoa7ZAxidJ2CV/AfZ/clah8AMtjUzcaOsVI9imEv0VV0YVrljYKTkpxC 7jvA==
- Importance: low
- In-reply-to: <CAEwQpa+DFAUcHj0_WU6KBvwu4SqwoxuOsUT=fUWQvrWEvnZSyg@mail.gmail.com>
- List-archive: <https://groups.google.com/a/noaa.gov/group/ferret_users/>
- List-help: <https://support.google.com/a/noaa.gov/bin/topic.py?topic=25838>, <mailto:ferret_users+help@noaa.gov>
- List-id: <ferret_users.noaa.gov>
- List-post: <https://groups.google.com/a/noaa.gov/group/ferret_users/post>, <mailto:ferret_users@noaa.gov>
- Mailing-list: list ferret_users@xxxxxxxx; contact ferret_users+owners@xxxxxxxx
- Organization: University of Bergen
- References: <20200619115546.226a51cd@gfi063209.klientdrift.uib.no> <CAEwQpa+DFAUcHj0_WU6KBvwu4SqwoxuOsUT=fUWQvrWEvnZSyg@mail.gmail.com>
- Sender: owner-ferret_users@xxxxxxxx
Ryo—
Je Sat, 20 Jun 2020 14:52:57 +0900 skribis Ryo:
> On Fri, Jun 19, 2020 at 6:57 PM Marco van Hulten <Marco.Hulten@xxxxxx>
> wrote:
>
> > I noticed that a trailing slash is ignored for in a string variable,
>
>
> I guess the correct statement is that trailing slashes are ignored *by the
> commands.*
>
> yes? define symbol ss "/abc/"
> yes? show symbol ss
> SS = "/abc/"
> yes? define symbol ss /abc/
> yes? show symbol ss
> SS = "/abc"
>
> That means that it was the "DEFINE SYMBOL" command which ignored the
> trailing backslash.
>
> Furthermore,
>
> yes? define symbol ss "/abc/"
> yes? say ($ss)
> !-> MESSAGE/CONTINUE /abc
> /abc
> yes? say "($ss)"
> !-> MESSAGE/CONTINUE "/abc/"
> /abc/
>
> In this case, it was the SAY command which ignored the trailing backslash.
>
> So, to avoid the trailing slash from being interpreted by the command, you
> quote the string.
Thanks, it looks like this works very well!
According to the manual [1], however, the syntax should contain an
equal sign, like
define symbol ss = something
instead of
define symbol ss something
Without the equal sign it works best, though, because you can use
quotation marks without them becoming part of the symbol. The
following two statements seem equivalent (according to what a quoted
SAY command tells me):
define symbol sja = ka\/\/
define symbol sja "ka/"
Earlier I was referring to my "solution" as "doubly escaping", but that
would rather look like \\/ (or \\\\ that one sometimes needs to print
a backslash); I don't know what \/\/ is or why I thought it was a good
idea to try it out.
The behaviour of variables of type string (DEFINE VARIABLE or LET)
seems more predictable to me, so I guess it is best to only use DEFINE
SYMBOL when absolutely needed (basically, to avoid `embedded
`backtics``).
If one would use the non-= syntax for LET, this happens:
yes? let aa = 3
yes? list aa
VARIABLE : 3
3.000
yes? let bb 7
yes? list bb
VARIABLE : 7
7.000
yes? let cc "abc"
**ERROR: command syntax: abc"
unclosed quotation, parenthesis, or bracket
suggesting it may be a bad habit to omit the equal sign. But I really
don't know! It seems that Ferret is quite lax in its syntax, but that
introduces some unpredictable behaviour! Unless we read the source, of
course.
—Marco
[1]: https://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/commands-reference/DEFINE
[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce /
NOAA /
OAR /
PMEL /
Ferret
Privacy Policy | Disclaimer | Accessibility Statement