Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename vue attribute macros to @if, @else, @elseif and @for #234

Merged
merged 3 commits into from
Oct 31, 2023

Conversation

hhaensel
Copy link
Member

Currently we have @iif, @els, @elsiifand @recur defined due to name clashes with Julia's reserved words.
From version 1.10 on one can get around that by defining a macro var"if".
However in order to be compatible, macro aliasing is a better way. So we keep the old definitions and alias them like

const var"@if" = var"@iif"

We even get the docstring right if we use it in the REPL:

help?> @if
  @if(expr)

  Generates v-if Vue.js code using expr as the condition. https://vuejs.org/v2/api/#v-if (https://vuejs.org/v2/api/#v-if)

  Example
  –––––––

  julia> span("Bad stuff's about to happen", class="warning", @if(:warning))
  "<span class="warning" v-if='warning'>Bad stuff's about to happen</span>"

@hhaensel hhaensel changed the title rename vue attribute macros to @if, @else, @elseif and @for rename vue attribute macros to @if, @else, @elseif and @for Oct 26, 2023
@hhaensel hhaensel requested a review from essenciary October 26, 2023 22:39
@hhaensel hhaensel merged commit a97266e into master Oct 31, 2023
20 checks passed
@hhaensel hhaensel mentioned this pull request Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants