是否可以修改函数参数? (如&在C ++中)

时间:2018-12-24 14:51:00

标签: ponylang

 actor Test
     fun foo(a: U32) =>
        a = a + 1

我希望test.foo(a)修改a。这可能吗?谢谢

1 个答案:

答案 0 :(得分:4)

您只能在课程级别修改lastId, err := resultPost.LastInsertID() if err != nil { panic(err) } fmt.Println("LastInsertId: ", lastId) 。这是有意的,因为参与者不喜欢就地更新-确实与无锁并发配合得不好。

默认情况下,函数具有Private Sub Plot() Dim DVHChart As Chart Dim ChartIndex1 As Integer Dim ChartName As String Set DVHChart = Charts.Add Application.ScreenUpdating = False 'DVH (Static) Plot With DVHChart .ChartType = xlXYScatterLines .ChartArea.Fill.Visible = True .ChartArea.Interior.Color = RGB(0, 0, 0) .PlotArea.Interior.Color = 0 .HasLegend = True .Legend.Font.ColorIndex = 2 .HasTitle = True .ChartTitle.Text = "Electric Field Volume Histogram (EVH)" .ChartTitle.Font.Color = RGB(255, 255, 255) Do Until .SeriesCollection.count = 0 .SeriesCollection(1).Delete Loop End With 'Set Y-Axis With DVHChart.Axes(xlValue) .MinimumScale = 0 .MaximumScale = 1 .MajorUnit = 0.1 .HasTitle = True .AxisTitle.Caption = "Normalized Volume (%)" .AxisTitle.Font.Size = 20 .AxisTitle.Font.Color = vbWhite .TickLabels.Font.Color = vbWhite .TickLabels.NumberFormat = "0.00" .HasMajorGridlines = True End With 'Set X Axis With DVHChart.Axes(xlCategory) .TickLabelPosition = xlTickLabelPositionLow .TickLabels.Orientation = 0 .TickLabels.Font.Color = vbWhite .HasTitle = True .AxisTitle.Caption = "Electric Field (V/m)" .AxisTitle.Font.Size = 14 .AxisTitle.Font.Color = vbWhite .MinimumScale = 0 .MaximumScale = 300 .MajorUnit = 25 .HasMajorGridlines = True End With 'Started changes here Worksheets("All Normalized").Unprotect Sheets("DVHChart").Unprotect Dim num As Integer Dim loc As String For num = 2 To 5 DVHChart.SeriesCollection.NewSeries DVHChart.SeriesCollection(num).Name = Worksheets("All Normalized").Range("A2").Value DVHChart.SeriesCollection(num).Values = Worksheets("All Normalized").Range(Cells(3, num), Cells(37, num)) 'Automation error here DVHChart.SeriesCollection(num).XValues = Worksheets("All Normalized").Range("A3:A37") DVHChart.SeriesCollection(num).Format.Line.DashStyle = msoLineSolid DVHChart.SeriesCollection(num).MarkerStyle = xlMarkerStyleNone DVHChart.SeriesCollection(num).Smooth = True DVHChart.SeriesCollection(num).Format.Line.Visible = msoFalse DVHChart.SeriesCollection(num).Format.Line.Visible = msoTrue DVHChart.SeriesCollection(num).Format.Line.ForeColor.RGB = RGB(255, 0, 225) Next num 'Ended changes here Dim imageName1 As String imageName1 = Application.DefaultFilePath & Application.PathSeparator & "DVH.bmp" With DVHChart.Parent .Width = 800 .Height = 600 .Top = Range("A1").Top .Left = Range("A1").Left End With End Sub 功能,这意味着由该功能操作的数据是只读的。为了确保函数可以对数据进行突变,需要将该方法声明为var

box

Playground