You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to julia...@googlegroups.com
I was interested to define "++" as operator for concatenating strings. I can define "+" for this purpose, but for "++" I get
julia>function++(x::String, y::String) x * y end ERROR: syntax: expected "("in"function" definition
I looked up "//" in Rational.jl, but did not see the difference in how to define this operation.
Steve Kelly
unread,
Jul 21, 2014, 5:57:41 PM7/21/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to julia...@googlegroups.com
I think the issue is that ++ is not an operator in julia.
Jake Bolewski
unread,
Jul 21, 2014, 6:06:30 PM7/21/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to julia...@googlegroups.com
It is not, look at julia-parser.scm for the list of operators you are able to define.
Hans W Borchers
unread,
Jul 21, 2014, 7:41:23 PM7/21/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to julia...@googlegroups.com
> It is not, look at julia-parser.scm for the list of operators you are able to define.
And I thought Julia allows to define operators as users like. Is there a special reason (inconsistency) why ++ would not not be allowed while // is? Could this be changed by an appropriate entry in julia-parser.scm (or somewhere else)?
Stefan Karpinski
unread,
Jul 21, 2014, 7:44:44 PM7/21/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Julia Users
Julia does not allow user-defined operators. There are just a lot of pre-defined operators. We could add ++ as an operator, but we'd have to decide how it parses and what it's precedence is. In Haskell it's an infix operator used for concatenation. In C it's a prefix and postfix operator that increments things. So there's no single obvious way to parse it.
Ben Arthur
unread,
Jul 22, 2014, 4:55:11 PM7/22/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to julia...@googlegroups.com
relatedly, is there a thread somewhere that explains why * is used for string concatenation and ^ for string repetition?
Stefan Karpinski
unread,
Jul 22, 2014, 4:58:53 PM7/22/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Julia Users
many threads: search "string concatenation"
Spencer Russell
unread,
Jul 22, 2014, 5:19:44 PM7/22/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message